LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-22-2008, 04:24 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
scp file with a specific port


I want to use scp to copy file from server A to server B , if I want the copying is via a specific port ( not use the default port ) , can advise what can i do ? thx
 
Old 09-22-2008, 04:32 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Use the -P switch followed by the port number you want to use.
Code:
man scp
for details
 
Old 09-22-2008, 05:32 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bathory View Post
Use the -P switch followed by the port number you want to use.
Code:
man scp
for details
thx reply ,

when use scp -p file.mine -P 22040 hostname:/destination

it pop

-P: No such file or directory
22040: No such file or directory

what is wrong ? thx
 
Old 09-22-2008, 05:41 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You must put first the scp options and then the files you want to copy, so either one of the following will do:
Code:
scp -p -P 22040 file.mine hostname:/destination
scp -P 22040 -p file.mine hostname:/destination
 
Old 09-22-2008, 09:41 PM   #5
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bathory View Post
You must put first the scp options and then the files you want to copy, so either one of the following will do:
Code:
scp -p -P 22040 file.mine hostname:/destination
scp -P 22040 -p file.mine hostname:/destination
thx ,

if I want to use rcp instead of scp , can advise what can i do ? thx
 
Old 09-23-2008, 03:05 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I'm not using rcp, but from the manpage I guess you need to use the -D option to specify a different port.
Code:
rcp -D 22040 file.mine hostname:/destination
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scp: port 22: No route to host xpucto Linux - Networking 4 10-22-2013 09:58 PM
TX/RX packets through a specific port? WorldBuilder Linux - Networking 3 01-02-2008 10:25 AM
Monitoring a Specific Port and Exporting to a log file chrisfirestar Linux - General 0 10-27-2003 04:17 AM
routing on a specific port stapper Linux - Networking 0 10-10-2002 01:08 PM
Telnet to a specific port... Harbinger Linux - Networking 1 01-28-2001 10:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration