scp command | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

scp command

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-29-2008
bn_unx bn_unx is offline
Registered User
 
Join Date: Sep 2008
Last Activity: 3 February 2009, 1:24 PM EST
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
scp command

I want to know

how can i use scp command in the reverse fashion

meaning i have two machines server1 and server2

I have files in server1 that i need to copy to server2

But i do not have write permissions on server2 although
i have read permissions on server1

is there a way i can go to server2 and read those files from server1
and have them copied to server2

so instead of doing scp file1 bn_unx@server2:/dir from server1

can i run scp command from server2 so that it reads files from server1 and copies them to server2
Sponsored Links
    #2  
Old 09-29-2008
avronius avronius is offline
Registered User
 
Join Date: Apr 2008
Last Activity: 22 May 2013, 8:38 AM EDT
Location: Calgary
Posts: 317
Thanks: 0
Thanked 0 Times in 0 Posts
If you do not have write permissions on a host, you will not be able to copy files there...
Well, you should be able to copy files to /tmp

scp will not bypass directory permissions
Sponsored Links
    #3  
Old 09-29-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Computer Geek
 
Join Date: Jul 2008
Last Activity: 10 July 2013, 11:06 AM EDT
Location: Frederick, MD
Posts: 748
Thanks: 4
Thanked 10 Times in 9 Posts
Copy file to someserver to current server:

Code:
scp /path/to/file {username}@server /path/to/newfile

Copy file from server to current server:

Code:
scp {username}@server:/path/to/file /path/to/newfile

But you need to have write permission on the server to want the file to copy to.
    #4  
Old 09-30-2008
lakshmananindia lakshmananindia is offline
Registered User
 
Join Date: Aug 2007
Last Activity: 20 January 2010, 6:19 AM EST
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Assume the two server IP will be 192.168.2.2 and 192.168.6.4. Assume that you are in 192.168.2.2. You can get the file as follows.

scp 19.168.6.4:~/filename .
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing command output from one command to the next command in cshell kaaliakahn UNIX for Dummies Questions & Answers 2 02-10-2012 04:59 PM
unix command : how to insert text at the cursor location via command line? xib.be UNIX for Advanced & Expert Users 0 12-22-2010 05:45 PM
Need help! command working ok when executed in command line, but fails when run inside a script! 4dirk1 Shell Programming and Scripting 4 12-02-2010 05:47 AM
awk command in script gives error while same awk command at prompt runs fine: Why? catalys Shell Programming and Scripting 4 09-20-2010 10:07 PM
awk/sed Command : Parse parameter file / send the lines to the ksh export command rajan_san Shell Programming and Scripting 4 11-06-2008 12:29 PM



All times are GMT -4. The time now is 08:38 PM.