安装 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 回来 =)

感谢大家的帮助!

相关内容