工具SSHSecure连接远程服务器步骤

一、远程连接工具SSHSecure的使用

实际开发中,Linux服务器都在其他的地方,我们要通过远程的方式去连接远程linux系统并操作它,Linux远程的操作工具有很多,企业中常用的有Puttty、secureCRT、SSH Secure等。在这里我使用SSHSecure工具进行远程连接服务器,该工具是免费的图形化界面及命令行窗口集一身的远程工具。安装包如下:

工具SSHSecure连接远程服务器步骤

安装后,会出现两个图标:

工具SSHSecure连接远程服务器步骤

点击图形化界面图标:

工具SSHSecure连接远程服务器步骤

工具SSHSecure连接远程服务器步骤

进入界面:

工具SSHSecure连接远程服务器步骤

工具SSHSecure连接远程服务器步骤

工具SSHSecure连接远程服务器步骤

关于远程工具乱码的解决:

使用远程工具进行连接时,如果linux有中文文件或目录,显示时会出现乱码,原因是linux编码是UTF-8,而远程工具默认是当前系统本地编码即GBK。所以解决方案是统一两者编码就OK了,但是该SSH Secure工具不能设置编码,所以通过修改linux的系统编码的方式进行统一编码。

在CentOS的/etc/sysconfig目录下有一个i18n的文件代表linux的系统编码

工具SSHSecure连接远程服务器步骤

将其从UTF-8修改成GBK重现连接linux即可:

工具SSHSecure连接远程服务器步骤

工具SSHSecure连接远程服务器步骤

若Ubuntu操作系统中,修改/etc/default/locale文件,将其中的zh_CN.UTF-8修改为zh_CN.GBK,重启即可

工具SSHSecure连接远程服务器步骤

二、远程服务器端开启ssh服务

1、首先以Ubuntu系统为例作为远程服务器系统(注意linux系统开发板或者虚拟机中的linux系统都可以看做是一个远程服务器系统),查看远程服务器是否已安装或启用了ssh服务,执行:

ps -e |grep ssh

1.1、看到ssh-agent和sshd,则说明服务器安装了ssh服务;然后查看是否ssh服务已经启动,执行:service sshd status,若发现显示的是stopoing的状态,执行:service sshd start;然后执行命令netstat -tnl 查看是否开启成功,如果开启成功,22端口会显示在listening的状态。

1.2、在客户端(window系统PC机为例),win+R执行cmd命令,利用ping+服务器地址,看是否能ping通,若是ping通了则利用SSHSecure工具进行连接远程服务器步骤。

1.3、可能出现的现象:

工具SSHSecure连接远程服务器步骤

  • 查看客户端和服务器的地址
  • 检查服务器防火墙是否开启,service iptables status ,发现防火墙开启了,于是执行命令:service iptables stop 进行关闭;

 

工具SSHSecure连接远程服务器步骤

  • 在服务器端执行vi /etc/ssh/sshd_config,文件的末尾添加如下内容:

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

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

    KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,[email protected]

  • 确保该文件中如下内容的不要被#注释:

       Port 22
       ListenAddress 0.0.0.0
       Protocol 2
注意:若更改后还是反复提示上述问题,建议重新下载一个新版本SSH-Secure安装(本人遇到这个坑,折腾了一下午,后来重新安装了一个版本的SSH-Secure就可以连上了!)

  • 保存文件,并且重启SSH,执行:service sshd restart 或者/etc/init.d/ssh restart,查看ssh服务状态,执行service sshd status或者/etc/init.d/ssh status;
  • 再次点击"connect",若反复提示输入password对话框,则打开 /etc/ssh/sshd_config,按照如下更改

       工具SSHSecure连接远程服务器步骤

  • 再次点击“connect”,可以正常传输文件了。

 

2如图若看到只有ssh-agent 这个是ssh-client客户端服务,没有sshd,则说明服务器没有安装ssh-server,则进行安装

ssh-server服务,执行:

sudo apt install openssh-server

sudo apt install openssh-client

开始安装,输入yes回车

工具SSHSecure连接远程服务器步骤

3、执行完了就代表安装完成了

工具SSHSecure连接远程服务器步骤

4、然后再执行

ps -e |grep ssh

发现多了sshd,远程连接本电脑就已经启用了

工具SSHSecure连接远程服务器步骤

5、然后我们通过其他电脑或服务器连接本电脑执行 ssh '你的用户名'@‘你的ip’,然后输入yes,然后输入密码,就成功连接了

工具SSHSecure连接远程服务器步骤

6、当然也重新执行第一部分的操作,利用客户端连接远程服务器。

参见:

https://blog.csdn.net/danielzhou888/article/details/76135934

https://www.cnblogs.com/ray-guan/p/9463350.html

https://www.cnblogs.com/wangwust/p/9747223.html