baseurl=http://mirrors.tuna.tsinghua.edu.cn/epel/8/Everything/x86_64/
gpgcheck=0
[Extras]
name=Extras
baseurl=
gpgcheck=0
yum -y install epel-release
yum repolist
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config & >> /dev/null
systemctl disable firewalld --now
systemctl stop firewalld --now
yum -y install yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce docker-ce-cli containerd.io
systemctl enable docker --now
systemctl status docker
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://uo5mrdxr.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
cat /etc/docker/daemon.json
docker run -dt --name shell04 centos
docker ps -a
docker exec -it 47eb4eed066f bash
vi wl20-04.sh
if [ -e /root/anaconda-sk.cfg ];then
echo "it is exist"
else
echo "it can't find"
fi
cat wl20-04.sh
vi gdad-04.sh
groupadd e01 >>/dev/null
for i in {1..20}
do
if [[ "$i"%2 -ne 0 ]];then
useradd -d /home/user$i -G e01 -s /bin/sh user$i
echo 123456789abc | passwd --stdin user$i >> /dev/null
else
useradd -d /home/user$i -G e01 -s /bin/bash user$i
echo 123456789abc | passwd --stdin user$i >> /dev/null
fi
done
chmod +x gdad-04.sh
bash gdad-04.sh
tail -n 20 /etc/passwd
docker run -dt --name gdf04 centos:7
docker exec -it gdf04 bash
mkdir /var/ad1
mkdir /var/ad2
useradd xiao04
chown xiao04 /var/ad2/
groupadd group04
chown root:group04 /var/ad1/
chmod 750 /var/ad2/
cd /var/
ls -l
cd /var/ad1
touch wl{01..06}.txt
chmod 777 wl01.txt
chmod 7777 wl02.txt
chmod 0777 wl03.txt
chmod 4777 wl04.txt
chmod 2777 wl05.txt
chmod 1777 wl06.txt
mkdir /var/ad3
useradd ad041
useradd ad042
useradd ad043
useradd ad044
setfacl -m u:ad041:rwx /var/ad3
setfacl -m u:ad042:rx- /var/ad3
setfacl -m u:ad043:r-- /var/ad3
setfacl -m u:ad044:--- /var/ad3
groupadd ad04
vi /etc/sudoers
ad041 ALL=(ALL) /usr/bin/cp
ad04 ALL=(ALL) /usr/bin/mv,/usr/bin/vi
cat /etc/sudoers
docker pull centos:8
docker run -idt --name gds04 --privileged=true centos:8 /sbin/init
docker exec -it gds04 bash
cd /etc/yum.repos.d/
rm -rf *.repo
vi gdr04.repo
[BaseOS]
name=BaseOS
baseurl=https://mirrors.aliyun.com/centos/8-stream/BaseOS/x86_64/os/
gpgcheck=0
[AppStream]
name=AppStream
baseurl=https://mirrors.aliyun.com/centos/8-stream/AppStream/x86_64/os
gpgcheck=0
[epel]
name=epel
baseurl=https://mirrors.aliyun.com/epel/8/Everything/x86_64/
gpgcheck=0
[Extras]
name=Extras
baseurl=https://mirrors.aliyun.com/centos/8-stream/extras/x86_64/os/
gpgcheck=0
cat gdr04.repo
yum repolist
yum -y install mariadb*
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
yynyy
mysqladmin
mysql -uroot -p123456
yum -y install net-tools
rpm -ql net-tools
docker inspect gds04 |grep -i network
docker inspect gds04 |grep -i gateway
mkdir -p /web/gd04-web1
docker run -dit --name gd04-web1 -v /web/gd04-web1/:/usr/local/apache2/htdocs/ --network host httpd
echo "hxm first site,my student ID is 07200104" >> /web/gd04-web1/index.html
docker inspect gd04-web1 |grep -i network
docker inspect gd04-web1 |grep -i IPAddress
curl http://192.168.236.134
mkdir -p /web/gd04-web2
docker run -dit --name gd01-web2 -p 8104:80 -v /web/gd04-web2/:/usr/local/apache2/htdocs --network bridge httpd
echo "hxm second site, my student ID is 07200104" >>/web/gd04-web2/index.html
docker inspect gd04-web2 |grep -i network
docker inspect gd04-web2 |grep -i IPAddress
curl http://192.168.236.134:8104
docker run -dit --name gd04-web3 -p 8204:80 -v /pub/html3/:/usr/local/apache2/htdocs --network bridge httpd
echo "hxm third site, my student ID is 07200104" >>/pub/html3/index.html
docker inspect gd04-web3 |grep -i network
docker inspect gd04-web3 |grep -i IPAddress
curl http://192.168.236.134:8204
docker pull tutum/lamp