安裝 bind /dev /run /proc 並重新啟動後被鎖定在 ssh 之外

安裝 bind /dev /run /proc 並重新啟動後被鎖定在 ssh 之外

我在 /etc/rc.local 檔案中新增了以下命令,以自動掛載核心的虛擬檔案系統,如 Linux From Scratch (LFS) 上所述。
並重新啟動...

部分
6.2.2 安裝和填滿 /dev
6.2.3。掛載虛擬核心檔案系統

mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run

if [ -h $LFS/dev/shm ]; then
  mkdir -pv $LFS/$(readlink $LFS/dev/shm
fi

現在,這是我嘗試 SSH bakk 時得到的結果:

ssh -vvv -i lfs.pem [email protected]   

OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016   
debug1: Reading configuration data /home/heitor/.ssh/config   
debug1: Reading configuration data /etc/ssh/ssh_config   
debug1: /etc/ssh/ssh_config line 19: Applying options for *   
debug2: resolving "52.22.192.60" port 22   
debug2: ssh_connect_direct: needpriv 0   
debug1: Connecting to 52.22.192.60 [52.22.192.60] port 22.   
debug1: Connection established.   
debug1: key_load_public: No such file or directory   
debug1: identity file dev/heitor/linux-from-scratch/lfs-ssh-rescue.pem type -1   
debug1: key_load_public: No such file or directory   
debug1: identity file dev/heitor/linux-from-scratch/lfs-ssh-rescue.pem-cert type -1   
debug1: Enabling compatibility mode for protocol 2.0   
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1   
ssh_exchange_identification: read: Connection reset by peer   

任何幫助表示讚賞。

答案1

我修復了在另一個實例中安裝該磁碟區的問題,刪除了損壞的命令並將其安裝回我的 Linux From Scratch 實例中。現在我可以正常 ssh 回來 =)

感謝大家的幫忙!

相關內容