$ sudo dnf install -y rsync
$ sudo visudo
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS" Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE" Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES" Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE" Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY" Defaults env_keep += "SSH_AUTH_SOCK"
$ sudo vi /etc/ssh/sshd_config
PermitRootLogin yes PasswordAuthentication yes
$ sudo systemctl restart sshd
$ sudo mkdir /root/.ssh $ sudo nano /root/.ssh/authorized_keys
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNo...
$ sudo chmod 700 /root/.ssh $ sudo chmod 600 /root/.ssh/authorized_keys
$ sudo rsync -rtlzvogpHAXP --delete --exclude /dev/ --exclude /proc/ --exclude /sys/ --exclude /var/run/ --exclude /var/lock/ --exclude ifcfg* --exclude ssh_host_* --exclude fstab --block-size=4096 -e "ssh -p12345" / skv0001:/
[sudo] tomoyan のパスワード: The authenticity of host '[skv0001]:12345 ([2401:2500:102:3014:153:126:156:195]:12345)' can't be established. ECDSA key fingerprint is SHA256:qPFDtQYOONtw4n5VXMhJ8+ArBePgdR9uPS0vCndYbTc. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes root@skv0001's password: sending incremental file list 〜省略〜 sent 736,315,419 bytes received 1,528,581 bytes 1,585,056.93 bytes/sec total size is 3,347,008,738 speedup is 4.54
$ sudo parted -l
モデル: HPT VD12-0 (scsi) ディスク /dev/sdb: 1000GB セクタサイズ (論理/物理): 512B/512B パーティションテーブル: msdos ディスクフラグ: 番号 開始 終了 サイズ タイプ ファイルシステム フラグ 1 1049kB 1000GB 1000GB primary lvm モデル: HPT VD12-1 (scsi) ディスク /dev/sdc: 7001GB セクタサイズ (論理/物理): 512B/512B パーティションテーブル: gpt ディスクフラグ: 番号 開始 終了 サイズ ファイルシステム 名前 フラグ 1 1049kB 7001GB 7001GB lvm
$ df -BM -T
ファイルシス タイプ 1M-ブロック 使用 使用可 使用% マウント位置 devtmpfs devtmpfs 8012M 0M 8012M 0% /dev tmpfs tmpfs 8024M 1M 8024M 1% /dev/shm tmpfs tmpfs 8024M 2M 8022M 1% /run tmpfs tmpfs 8024M 0M 8024M 0% /sys/fs/cgroup /dev/mapper/fedora-root ext4 9952M 244M 9180M 3% / /dev/mapper/fedora-usr ext4 9952M 4529M 4895M 49% /usr tmpfs tmpfs 8024M 1M 8024M 1% /tmp /dev/mapper/fedora-home ext4 4912M 449M 4191M 10% /home /dev/mapper/fedora-boot ext4 614M 206M 364M 37% /boot /dev/mapper/fedora-var ext4 7468524M 6138649M 1017249M 86% /var tmpfs tmpfs 1605M 1M 1605M 1% /run/user/42 tmpfs tmpfs 1605M 0M 1605M 0% /run/user/1001
$ sudo parted -l
モデル: Virtio Block Device (virtblk) ディスク /dev/vda: 275GB セクタサイズ (論理/物理): 512B/512B パーティションテーブル: msdos ディスクフラグ: 番号 開始 終了 サイズ タイプ ファイルシステム フラグ 1 1049kB 525MB 524MB primary ext4 boot 2 525MB 2690MB 2164MB primary linux-swap(v1) 3 2690MB 275GB 272GB primary btrfs
$ df -BM -T
ファイルシス タイプ 1M-ブロック 使用 使用可 使用% マウント位置 /dev/vda3 btrfs 259579M 10458M 247838M 5% / devtmpfs devtmpfs 995M 0M 995M 0% /dev tmpfs tmpfs 1002M 0M 1002M 0% /dev/shm tmpfs tmpfs 1002M 2M 1001M 1% /run tmpfs tmpfs 1002M 0M 1002M 0% /sys/fs/cgroup tmpfs tmpfs 1002M 1M 1002M 1% /tmp /dev/vda3 btrfs 259579M 10458M 247838M 5% /home /dev/vda1 ext4 477M 207M 245M 46% /boot tmpfs tmpfs 201M 0M 201M 0% /run/user/1001
$ sudo grub2-install /dev/vda
Installing for i386-pc platform. Installation finished. No error reported.
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
enerating grub configuration file ... Found linux image: /boot/vmlinuz-4.1.10-200.fc22.x86_64 Found initrd image: /boot/initramfs-4.1.10-200.fc22.x86_64.img Found linux image: /boot/vmlinuz-4.1.8-100.fc21.x86_64 Found linux image: /boot/vmlinuz-4.0.4-202.fc21.x86_64 Found initrd image: /boot/initramfs-4.0.4-202.fc21.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-7725dfc225d14958a625ddaaaea5962b Found initrd image: /boot/initramfs-0-rescue-7725dfc225d14958a625ddaaaea5962b.img done
$ sudo cp /boot/initramfs-4.1.10-200.fc22.x86_64.img /boot/initramfs-4.1.10-200.fc22.x86_64.img.bak $ sudo dracut -f /boot/initramfs-4.1.10-200.fc22.x86_64.img 4.1.10-200.fc22.x86_64
$ ssh skv0001 $ sudo reboot
Connection to skv0001 closed by remote host. Connection to skv0001 closed.
$ ssh skv001 $ sudo systemctl stop httpd $ sudo systemctl stop mariadb
$ sudo rsync -rtlzvogpHAXP --delete --exclude /dev/ --exclude /proc/ --exclude /sys/ --exclude /var/run/ --exclude /var/lock/ --exclude ifcfg* --exclude ssh_host_* --exclude fstab --block-size=4096 -e "ssh -p12345" / skv0001:/
[sudo] tomoyan のパスワード: root@skv0001's password: sending incremental file list 〜省略〜 sent 4,864,296 bytes received 243,750 bytes 101,149.43 bytes/sec total size is 3,334,430,460 speedup is 652.78
$ sudo nano /etc/ssh/sshd_config
PermitRootLogin no PasswordAuthentication no
$ sudo systemctl restart sshd
$ sudo systemctl stop softether-vpnserver $ sudo systemctl stop softether-vpnclient $ sudo systemctl disable softether-vpnserver
Removed /etc/systemd/system/multi-user.target.wants/softether-vpnserver.service.
$ sudo systemctl disable softether-vpnclient
Removed /etc/systemd/system/multi-user.target.wants/softether-vpnclient.service.