ubuntu系统启动ssh服务报错导致无法远程连接问题解决

  • 安装完ubuntu系统后,启动远程ssh连接服务端口(22端口)时报错,错误信息如下:

image-20201015155230703

解决方案:

yunjia@yunjia-virtual-machine:~$ sudo /usr/sbin/sshd 
Missing privilege separation directory: /var/run/sshd
yunjia@yunjia-virtual-machine:~$ mkdir /var/run/sshd
yunjia@yunjia-virtual-machine:~$ sudo /usr/sbin/sshd 
yunjia@yunjia-virtual-machine:~$ netstat -nlt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 ::1:631                 :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
yunjia@yunjia-virtual-machine:~$

由上面可以看出22端口已经启动,这样我们就可以远程登录这台服务器了。

相关推荐
©️2020 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页