为什么我的scp只在一边工作? “丢失连接”SCP转移

我试图通过ssh传输文件,但它只能从PC1传输到PC2,但不能正常工作。

我检查过我的ssh_config文件,两者都是一样的。 这是基本的:

Host * SendEnv LANG LC_* HashKnownHosts GSSAPIAuthentication yes GSSAPIDelegateCredentials no 

因为我也试着把这个添加到接收者ssh_config

 PasswordAuthentication no Port 22 Protocol 2, 1 

而且它仍然不起作用。

这是我的I / O

 :~# scp -v testFile.txt [email protected]:/home 
 Executing: program /usr/bin/ssh host 192.168.1.67, user root, command scp -v -t /home OpenSSH_5.1p1 Debian-5, OpenSSL 0.9.8o 01 Jun 2010 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.1.67 [192.168.1.67] port 22. debug1: connect to address 192.168.1.67 port 22: Connection refused ssh: connect to host 192.168.1.67 port 22: Connection refused lost connection 

我错过了什么?

从你给出的输出看起来你的主机不接受端口22上的连接。

ssh: connect to host 192.168.1.67 port 22: Connection refused

检查您的防火墙configuration,并确保它允许从所有位置的端口22上的ssh连接。

另外请确保在对sshd_config进行更改后重新启动了sshd

您可以通过运行service sshd restart/etc/init.d/sshd restart来完成此操作

如果您需要进一步的帮助,请发布iptables -L的输出