Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Specify a port with the scp command

Answer:

If you want to use scp to copy file to remote machine, but that ssh server is listening at port other than 22, you can use the following command syntax.

# scp -P 6000 test.txt john@remoteserver:/home/john/

Please notes it is -P, not -p.

  1. Use an alternative port when connecting to remote server using SSH
  2. Simple port forwarding using SSH
  3. What is the SMTP submission port 587?
  4. Copy file to remote server using scp
  5. Kill all processes listening on a particular port

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>