docker backup 備份
sudo docker image_name > backupname.tar
sudo docker save –outpu backupname.tar image_name
sudo docker save -o backupname.tar image_name
docker recovery 還原
sudo docker load < backupname.tar.gz
sudo docker load –input backupname.tar
下載image 來修改
sudo docker pull rastasheep/ubuntu-sshd:16.04
sudo docker run -it –name=sshdtest rastasheep/ubuntu-sshd:16.04 /bin/bash
apt-get update; apt-get install -f -y vim net-tools htop
vi /run.sh
#!/bin/bash
/usr/sbin/sshd -D &
chmod +x /run.sh
======
安裝和設定
apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get purge `dpkg -l | grep php| awk ‘{print $2}’ |tr “\n” ” “`
apt-get update
apt-get install zip unzip mysql-server apache2 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-mbstring php-xdebug libapache2-mod-php5.6 php5.6-mcrypt php5.6-mysql php5.6-xml
php -v
—–
php7.2 可以移除或是設定切換
apt-get purge 7.2
切換 5.6到7.0(7.2)
From php5.6 to php7.0:
Apache:
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
CLI:
sudo update-alternatives –set php /usr/bin/php7.0
From php7.0 to php5.6:
Apache:
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
CLI:
sudo update-alternatives –set php /usr/bin/php5.6
sudo docker run -it ubuntu:16.04 /bin/bash
apt-get update
apt-get install vim openssh-server net-tools htop
建立執行的目錄並且執行
mkdir -p /var/run/sshd
/usr/sbin/sshd -D &
確認服務和連接埠
netstat -tunlp
讓Root可以登入
cd /etc/ssh
vi sshd_config
PermitRootLogin prohibit-password ==>PermitRootLogin yes
sed -ri ‘s/^session\s+required\s+pam_loginuid.so$/session optional pam_loginuid.so/’ /etc/pam.d/sshd
產生key 並給root使用
mkdir ~/.ssh
cd /root/.ssh
ssh-keygen -t rsa
cat id_rsa.pub
vi /run.sh
#!/bin/bash
/usr/sbin/sshd -D &
chmod +x /run.sh
sudo docker commit ID name:tag
======
sudo docker pull rastasheep/ubuntu-sshd:16.04
sudo docker run -it –name=sshdtest rastasheep/ubuntu-sshd:16.04 /bin/bash
apt-get update; apt-get install -f -y vim net-tools htop
vi /run.sh
#!/bin/bash
/usr/sbin/sshd -D &
chmod +x /run.sh
隨機文章
- TrueNAS Core NextCloud 簡測心得 (2021-07-21)
- OLPC-百元筆記本OLPC出現供貨危機 買二增一計劃推遲 (2007-11-03)
- 搶到紅米Note (2014-07-08)
- 在PiHole之後,我安裝的是ADGuard Home (2020-09-20)
- Linux環境下,安裝instaloader,出現error: externally-managed-environment (2024-11-11)