I'm trying to copy a folder from one system to another using scp (secure copy) however I cannot work out how to specify the port.
I understand that to scp, I can...
scp /file/location/folderName user@192.***.*.***:/destination/location/
ssh: connect to host ..*.*** port 22: Connection refused lost
scp /file/location/folderName user@192.***.*.***:>>portNumHere<</destination/location/
scp -r -P >>portNumHere<< /file/location/folderName user@192.***.*.***:/destination/location/
Use a capital
-P port. The lower case
-p option conflicts with the
-p "preserve" option from
Per the man page:
scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2 ... -P port Specifies the port to connect to on the remote host. Note that this option is written with a capital ‘P’, because -p is already reserved for preserving the times and modes of the file.