2

When I'm connecting to server from my local desktop - it is connecting.

When I'm using scp over port 22 - have timeout.

I'm using following commands to connect via SSH:

ssh -p 22 [email protected]

and it is connected and I can log in

After that I want to copy the file from the server IP 192.168.12.10:

scp -P 22 /home/user1/Desktop/1.txt [email protected]:/home/user2/Desktop

Her I'm getting the following error

ssh: connect to host 192.168.12.10 port 22: Connection timed out
lost connection

In Ubuntu 10.04 everything works fine.

I am getting problem for Ubuntu 12.04 only. I can connect to server using ssh and I cannot copy the file using scp.

What is the problem?

2
  • As I understand you can copy via scp using Ubuntu 10.04, and cannot copy from same server using Ubuntu 12.04. Am I correct?
    – c0rp
    Jul 8, 2014 at 7:13
  • yes your right exactly I need a solution please
    – murthy
    Jul 8, 2014 at 9:29

2 Answers 2

1

While -p is the valid option to specify the port to connect to the ssh command, it is not for the scp command.

The -P (capital P) is the parameter to specify the port to connect to the scp command.

The -p parameter (with any value after it) is used to ask scp to preserve modification times, access times, and modes from the original file. Like the -p option of the local copy command, cp.

By the way, 22 beeing the default SSH port, no need to explicitly specify it to the command line.

1
  • I have replaced the command (small p to capital P) till same error
    – murthy
    Jul 8, 2014 at 9:23
0

Add the ssh 192.168.xx.xx subnet 255.255.xxx.xxx to the host.allow file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .