SecureCRT通过SSH2协议远程登录Ubuntu 18.04的过程总结 - limanjihe

时间:2024-02-22 14:06:36

SecureCRT通过SSH2协议远程登录Ubuntu 18.04的过程总结

 reference: https://blog.csdn.net/ghostar03/article/details/47441715 

                  https://blog.csdn.net/u011186256/article/details/79963544

 

  要用SecureCRT连接Ubuntu,在linux中ssh程序分为 :openssh-client和 openssh-server。如果需要ssh登陆到别的电脑,需要安装openssh-client,该程序ubuntu是默认安装的。而如果需要从远程连接到本机,则需要安装openssh-server,该程序需要自己安装。
   环境:windows10、虚拟机Ubuntu 18.04

   协议:SSH2

   windows端软件:SecureCRT

        Ubuntu端软件:openssh-server


 

Windows端使用:

创建链接

 

 新建链接:

 

选择通信协议:

然后根据IP设置

 

 

 


 

Ubuntu端安装:

 

1、首先要安装ssh功能:

sudo  apt-get install openssh-server

此时出现错误--Could not get lock /var/lib/dpkg/lock

接着在终端输入:

sudo rm /var/lib/dpkg/lock

然后再运行安装代码

sudo apt-get install openssh-server

sudo apt-get install openssh-client

查看openssh-server是否启动  

$ ps-e | grep sshd   或ssh

 

启动ssh服务

 

2、修改配置文件

 

 sudo pico /etc/ssh/ssh_config
去掉PasswordAuthenitcation, Port 22,Protocol2,1这三行前的注释#

 

运行发现

 

秘钥交互失败,需要修改相关配置文件:

将ssh_config文件中的

 Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc

 MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160

复制到sshd_config文件中,然后重启服sshd服务器

/etc/init.d/ssh restart

连接成功:

 解决中文乱码问题,选择外观-字符编码(UTF-8):

 

 


 

现在我们已经可以正常连接使用我们虚拟的Linux,但是现在还有一个问题,我们怎么在他们直接传输文件呢,有人说可以设立共享文件夹,可是如果是VPS主机的话怎么办呢?

下面介绍一个经典的文件传输的工具rz(上传)和sz(下载)

有的ubuntu源里面可能没有了,如果有的话可以方便的直接安装

sudo  apt-get  install   lrzsz

可是如果源里面没有怎么办呢,没关系,下面说怎么安装

1、下载源码

wgethttp://down1.chinaunix.net/distfiles/lrzsz-0.12.20.tar.gz

2、tar zxvf  lrzsz-1.12.20.tar.gz

3、cd lrzsz-1.12.20

4、./configure–prefix=/usr/local/lrzsz

5、make

6、make install

7、建立符号连接

#cd  /usr/bin

#ln -s  /usr/local/lrzsz  /bin/lrz  rz

#ln -s  /usr/local/lrzsz  /bin/lsz  sz

8、试试

当在SecureCRT里面运行rz 的时候就会弹出SecureCRT上传窗口,文件会传到当前的目录了。

 

Ps:可以管理多个linux主机哦,那你就拥有一个Linux主机集群啦。