Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to transfer a file via ssh but it works only from PC1 to PC2 but it doesn't work backwards.

I've checked my ssh_config files and both are the same. Which is basic:

Host *
SendEnv LANG LC_*
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no

Because i've also trying adding this to the recievers ssh_config

PasswordAuthentication no
Port 22
Protocol 2, 1

And it still doesn't work.

Here's my I/O

:~# scp -v testFile.txt user@
Executing: program /usr/bin/ssh host, 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 [] port 22.
debug1: connect to address port 22: Connection refused
ssh: connect to host port 22: Connection refused
lost connection

What am I missing?

share|improve this question
my Firewall is Disabled –  AAlvz Mar 1 '13 at 19:19
You Are you sure SSH is still running on that machine? BTW, you should consider upgrading Debian 5 is end of life. –  Zoredache Mar 1 '13 at 19:27
@Zoredache I checked that sshd is running with ps aux | grep sshd also, I'm using this debian because upgrading to 6 gave me some troubles on this special server.. –  AAlvz Mar 4 '13 at 15:43

1 Answer 1

up vote 1 down vote accepted

From your given output it looks like your host isn't accepting connections on port 22.

ssh: connect to host port 22: Connection refused

Check your firewall configuration and make sure it's allowing ssh connections on port 22 from all locations.

Also make sure that you restarted sshd after making changes to sshd_config.

You can do this by running service sshd restart or /etc/init.d/sshd restart

If you need any further help, post the output of iptables -L

share|improve this answer
I forgot to say that i've already disabled Firewall –  AAlvz Mar 1 '13 at 19:18
yes. That was the problem. Just enabled PasswordAuthentication yes in the sshd_config file. Thankyou! –  AAlvz Mar 24 '13 at 20:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.