How can I specify a port for the destination ip? When I do scp -p 0000 it still tries to connect on port 22, not the one I'm specifying.

scp svn_backup.tgz user@xxx.xxx.xx.xxx:/path/to/new/svn/
link|improve this question

You can find great information reading manual pages. man scp, for example. – motobói Mar 20 at 11:47
feedback

2 Answers

up vote 9 down vote accepted

Capital "P".

$ scp -P 12345 svn_backup.tgz user@xxx.xxx.xx.xxx:/path/to/new/svn/

See $ man scp for more details.

link|improve this answer
Hooray for consistency! – David Mackintosh Jun 11 '10 at 16:58
1  
@David: scp was designed to imitate rcp, and rcp used -p to "preserve file times and modes". See man scp. – grawity Jun 11 '10 at 19:08
feedback

[I'd rather add a comment, but not enough 'reputation' for that yet.]

It's also noteworthy that the port specification must come before the file name, i.e.:

scp svn_backup.tgz -P 12345 user@xxx.xxx.xx.xxx:/path/to/new/svn/

*won't work.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.