安装ssh

apt-get install openssh-server

修改sshd配置文件

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak

修改内容:

Port 23 # 端口改为23,22端口已被系统占用
ListenAddress 0.0.0.0 # 取消注释
#StrictModes yes # 注释
PasswordAuthentication yes # 允许密码登录

启动ssh

service ssh start

如果提示sshd error: could not load host key,则用下面的命令重新生成

sudo rm /etc/ssh/ssh*key
dpkg-reconfigure openssh-server

出处:http://www.it1352.com/725354.html

Leave a Reply

Your email address will not be published. Required fields are marked *