Solved: Cannot scp to CentOS box

Now, I have a centos box that recently been setup. This would be my dev server. The first thing that i would want to do is to use WinSCP to transfer files to and fro. However, here is something...

I cannot scp to CentOS...the error says "Network Error: Connection refused". Naturally i've googled for the solution and WinSCP page have it all. But it does not solve my problem. I've:

  • setup the firewall (even disable the firewall to check for connection)
  • ensure the sshd is running
  • and few other solutions found online.

That box is in server room and i'm too lazy to walk there just to puch in some commands. So, I just ssh using putty to the box. What!!, wait... I actually *can* ssh to the box....I see the light at the end of the tunnel...woot...

To cut the story short.... if you CAN ssh but CANNOT scp/sftp... do the following:

1.  check the promission of /dev/null. If the permission as follows:

[root@localhost ~]# cd /dev
[root@localhost dev]# ls -all null
crw-rw-rw- 1 root root 1, 3 Jan 23 17:49 null

2. change the permission to crw-------

[root@localhost dev]# chmod 600 null
[root@localhost dev]# ls -all null
crw------- 1 root root 1, 3 Jan 23 17:49 null

That should do the trick.