LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 05:24 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
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, 05:32 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,903

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

Original Poster
Rep: Reputation: 30
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, 06:41 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,903

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
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, 10:41 PM   #5
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
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, 04:05 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,903

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:58 PM
TX/RX packets through a specific port? WorldBuilder Linux - Networking 3 01-02-2008 11:25 AM
Monitoring a Specific Port and Exporting to a log file chrisfirestar Linux - General 0 10-27-2003 05:17 AM
routing on a specific port stapper Linux - Networking 0 10-10-2002 02:08 PM
Telnet to a specific port... Harbinger Linux - Networking 1 01-28-2001 11:41 AM

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

All times are GMT -5. The time now is 05:25 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration