Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
46
rated 0 times [  46] [ 0]  / answers: 1 / hits: 137384  / 2 Years ago, fri, february 18, 2022, 4:44:48

I am trying to copy file from my server to another so I am using the following command:



scp root@myhost /home/direc/file.tar username@secondhost:/home/dir


I am getting the error:



ssh: connect to host secondhost port 22 connection timed out



I know it might be because port 22 is not open on second host



so How do I transfer by specifying port 21 on my second host


More From » scp

 Answers
6

Try



scp -P 21 root@myhost /home/direc/file.tar username@secondhost:/home/dir


Where -P stands for port number.


[#35838] Saturday, February 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ronicod

Total Points: 71
Total Questions: 111
Total Answers: 111

Location: Montenegro
Member since Fri, Dec 10, 2021
2 Years ago
ronicod questions
Thu, Nov 11, 21, 06:26, 3 Years ago
Sun, May 7, 23, 13:57, 1 Year ago
Sun, Jun 26, 22, 06:13, 2 Years ago
Fri, Oct 14, 22, 13:55, 2 Years ago
;