ubuntu 16.0 安装openssh和启动

假装没事ソ 提交于 2019-12-04 11:01:04

安装openssh和启动

由于openssh依赖于openssl库,所以在安装openssh前要先安装openssl库
Ubuntu默认安装了ssh client端但没有安装Server端,所以首先安装ssh-server服务。命令如下:

sudo apt-get install openssh-server

server启动后出现 root连接时显示ssh服务器拒绝了密码,sshd的设置不允许root用户用密码远程登录;

//异常信息
Permission denied, please try again.

通过打开sshd_config

vim /etc/ssh/sshd_config

找到PermitRootLogin制成yes;

# Authentication:
LoginGraceTime 120
PermitRootLogin prohibit-password
StrictModes yes
12345

更改

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
12345
//然后输入命令重新启动server
/etc/init.d/ssh restart 

//启动service ok
[ ok ] Restarting ssh (via systemctl): ssh.service.

scp -r 命令文件上和下载

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!