0
点赞
收藏
分享

微信扫一扫

Ubuntu--安装ssh--方法/教程SecureCRT连接错误:Key exchange failed ...


简介

        本文介绍如何在Ubuntu下安装ssh。

安装步骤

简介

        ubuntu默认没有安装ssh服务,如果通过ssh连接,需要自己手动安装ssh-server。

验证是否安装

可以通过如下命令判断系统是否有安装ssh服务:

$ ssh localhost   
ssh: connect to host localhost port 22: Connection refused

如上所示,表示还没有安装。

安装openssh

可以通过apt安装,命令如下:

sudo apt-get install openssh-server

启动ssh服务

法1:systemctl命令

sudo systemctl start ssh

法2:原生ssh

sudo /etc/init.d/ssh start

查看是否启动

法1:systemctl命令

sudo systemctl status ssh

看到如下内容即表示成功 :

Active: active (running)

法2:ps查看

$ ps -e|grep ssh   
3978 ? 00:00:00 sshd

如上表示启动ok。

关闭ssh服务

 法1:systemctl命令

sudo systemctl stop ssh

法2:原生ssh

sudo /etc/init.d/ssh stop

开机自启

开机自动启动ssh命令

sudo systemctl enable ssh

关闭开机自动启动ssh

sudo systemctl disable ssh

配置文件

        一般使用默认配置即可。

        ssh默认的端口是22,可以更改端口,更改后先stop,然后start就可以了。

配置文件:/etc/ssh/sshd_config:

$ vim /etc/ssh/sshd_config   
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22

问题解决

SecureCRT连接错误:Key exchange failed ...

解决方法

        右键“Sessions”下边的对话=> 属性=> 连接=> SSH2=> 右侧“密钥交换”=> 选择报错提到的已经支持的协议


举报

相关推荐

0 条评论