Ubuntu20.04.3设SSH服务器

Ubuntu20.04.3设SSH服务器,第1张

Ubuntu20.04.3设SSH服务器

一、安装opensshd-server
可以直接 执行命令
sudo  apt-get install openssh*
如果出现以下错误:
The following packages have unmet dependencies:
 openssh-server : Depends: openssh-client (= 1:8.2p1-4ubuntu0.2)
 openssh-sftp-server : Depends: openssh-client (= 1:8.2p1-4ubuntu0.2)
 openssh-tests : Depends: openssh-client (= 1:8.2p1-4ubuntu0.2)
E: Unable to correct problems, you have held broken packages.
则先执行以下命令
sudo  apt-get install openssh-client=1:8.2p1-4ubuntu0.2
再执行命令
sudo  apt-get install openssh*

二、安装完成后,修改配置文件
vim /etc/ssh/sshd_config
将#Port 22改为Port 22

将#PermitRootLogin prohibit-password
改为
PermitRootLogin yes

三、最后重启服务使其生效
 ./etc/init.d/ssh restart

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/5682157.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存