Ubuntu20安装ssh服务

Ubuntu20上执行如下命令查看是否存在ssh服务

#ps -e | grep ssh

只有ssh-agent ,没有sshd; 因此要安装openssh-server.

搜索openssh-server,得到下载链接:

openssh-server

复制这个Binary Package链接即可下载,然后使用如下命令安装

sudo dpkg -i  binary_file 

这个时候会提示版本不对,依赖也有缺陷

那么就去选择正确的版本,依然在刚才那个页面,两个文件都下载好后,继续安装,就成功了

sftp

这个时候再去查看服务,发现:

打开ssh终端来连接这个服务器

这个时候,你可能会遇到Key exchange failed的问题;原因是服务器端sshd支持的密钥交换策略与你使用的终端,比如secureCRT支持的终端不一致,尤其是老版本的secureCRT,比如6.5,就不支持新的策略:

Key exchange failed. No compatible key exchange method. 
The server supports these methods: 
curve25519-sha256,
curve25519-sha256@libssh.org,
ecdh-sha2-nistp256,ecdh-sha2-nistp384,
ecdh-sha2-nistp521,
diffie-hellman-group-exchange-sha256,
diffie-hellman-group16-sha512,
diffie-hellman-group18-sha512,
diffie-hellman-group14-sha256 

这个时候,要么更换更高版本的securecrt,要么新增支持的策略。

可以修改/etc/ssh/sshd_config, 记住是 sshd_config 不是 ssh_config。

SecureCRT SSH连接报错Key exchange failed 问题处理记录_feverlook-腾讯云开发者社区

KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1

添加如上这行,就可以了;

此外,putty会支持各种策略,即使secureCRT连不上,putty可以连上

相关推荐
likfishdn几秒前
Linux的文件与目录管理
linux·运维·服务器
chian-ocean20 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=22 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
北京耐用通信1 小时前
航空装配自动化神器Ethercat转profient网关搭配机器人精准控制
运维·机器人·自动化
吃汤圆的抹香鲸1 小时前
Rider 安装包 绿色版 Win/Mac/Linux 适合.NET和游戏开发者使用 2025全栈开发终极指南:从零配置到企业级实战
linux·运维·windows·sql·游戏·macos·.net
崔lc4 小时前
linux中安装部署Jenkins,成功构建springboot项目详细教程
运维·jenkins
luojiaao4 小时前
【Jenkins】个人向-Jenkinsfile如何写
运维·jenkins
wanhengidc8 小时前
单线服务器和双线服务器分别是指什么?
运维·服务器
海绵宝宝10 小时前
Linux中常见命令使用
linux·运维·服务器