Ubuntu中使用SSHSecure Shell测试Windows与Linux系统间操作及传输问题解决大全

安装SSH服务器

Linux终端下输入sudo apt-get install openssh-server


桥接模式IP设置

inux 与Windows 都是设置为自动获取 IP 地址,然后调到第一次测试一栏开始。


桥接模式IP设置

需要为 Linux 设置一个与 Windows 系统同一个网段的静态 IP 地址。
在图形界面进入系统设置,选择网卡设置, IPV4 设置为“手动”,
并在地址栏填写 IP 地址、掩码等信息。

本人设置

windows IP 172.31.140.176

Linux      IP 172.31.196.180 

子网掩码都是255.255.0.0


ping测试

用ping 命令测试 Windows 和 Linux 之间能否正常通信。

在 Windows,打开 cmd 命令行,输入 ping IP命令进行测试。如下图为成功


在Linux,在终端输入ping IP命令进行测试。如下图为成功。

注意:Linux中可以使用Ctrl+c停止ping,不然会一直ping下去。


在Linux,在终端输入ping 127.0.0.1 来与本机终端测试。下图为成功


若ping失败,请检查IP设置


查看防火墙状态

Linux终端下输入service iptables status

下图为正常关闭

iptables 所在目录 /etc/sysconfig/iptables

service iptables status 查看iptables状态
service iptables restart iptables服务重启
service iptables stop iptables服务禁用

第一次测试SSH连接

Windows下安装并打开 SSH Secure Shell Client 软件,点击quick connect

输入Linux的IP地址及用户名,回车


若出现以下错误,进入下一步调试。





查看SSH服务

Linux终端下输入service sshd status,确保为active(running)


修改SSH服务器配置文件

Linux终端下输入 sudo vim /etc/ssh/sshd_config(没安装vim可用vi)

打开文件后,在最后添加以下段落:


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,[email protected],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]


这是新版弃用的加密方式。

修改后:X或:wq保存退出


重启sshd服务

Linux终端下输入sudo service ssh restart


第二次测试


第一次成功会弹出此窗口,按yes。然后输入密码。done!


不过,本软件对中文支持不好



传输成功截图


Well done!




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章