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可以连上

相关推荐
-dcr3 分钟前
58.DevOps进阶
运维·devops
猫头虎6 分钟前
如何使用Docker部署OpenClaw汉化中文版?
运维·人工智能·docker·容器·langchain·开源·aigc
XiaoMu_0016 分钟前
自动化漏洞扫描与预警平台
运维·网络·自动化
醉风塘8 分钟前
Linux进程管理:深度解析ps -ef命令及其高级应用
linux·运维·服务器
会周易的程序员16 分钟前
openplc runtimev4 Docker 部署
运维·c++·物联网·docker·容器·软件工程·iot
陈桴浮海44 分钟前
【Linux&Ansible】学习笔记合集三
linux·运维·云原生·ansible
小Pawn爷1 小时前
1.Docker基础
运维·docker·容器
chinesegf1 小时前
清理docker残留镜像images
运维·docker·容器
江湖有缘1 小时前
基于华为openEuler系统部署Gitblit服务器
运维·服务器·华为
EnglishJun1 小时前
Linux系统编程(二)---学习Linux系统函数
linux·运维·学习