LinuxQuestions.org
Help answer threads with 0 replies.
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 02-19-2013, 01:14 AM   #1
saikrishnaprasadh
LQ Newbie
 
Registered: May 2010
Posts: 4

Rep: Reputation: 0
sudo copy issue


Hi,

I have sudo access in a remote server, i need to get the files files from the remote server using the scp or rsync .. please tell me how to do it.

ps: i cannot copy from the remote server like sudo cp as it has been blocked. i can copy the files only using get method like below

scp username@remoteserver:/var/log/xxx.file /tmplocalserver

can any one point me the correct method ??
 
Old 02-19-2013, 01:25 AM   #2
RaviTezu
Member
 
Registered: Nov 2012
Location: India
Distribution: Fedora, CentOs, RHEL
Posts: 164

Rep: Reputation: 24
Quote:
Originally Posted by saikrishnaprasadh View Post
That wont work. i guess!

Login to the remote machine and copy it to the destination:

Let's say you have to copy the file from host A to host B:
The command you should be using this on the host which is having the file(i.e A here)..
Quote:
scp /path_of_file_on_A username@B:/path_on_host_B
You should be having the permissions to copy the file to this path(i.e /path_on_host_B)

Last edited by RaviTezu; 02-19-2013 at 01:27 AM.
 
Old 02-19-2013, 01:33 AM   #3
sharadchhetri
Member
 
Registered: Aug 2008
Location: INDIA
Distribution: Redhat,Debian,Suse,Windows
Posts: 179

Rep: Reputation: 23
Hello Sai,
I think I read your question and get confused with cp and scp.

Make me correct if I am wrong somewhere
* you can not run cp command in server because of sudo restriction
* you can only do scp to remote machine from your system

So I am pointing the below method on scp command only.

For eg.

Remote File name = remotetest.txt
Local File name - localtest.txt


Remote Machine Name = ServerA

Your machine name = laptop

Now you are here only using your laptop .And will do scp only from your laptop , not from inside of the server


Method (1) ;Login in your laptop (I hope it is linux machine)

to scp a file from your laptop to remote server

scp localtest.txt username@serverA:/path/in/server

eg.

scp localtest.txt user1@ServerA:/opt/


Method (2) Second method you already typed. That was getting file from remote server to your laptop

scp user1@ServerA:/path/remotetest.txt ~/Desktop

Last edited by sharadchhetri; 02-19-2013 at 01:35 AM.
 
  


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
sudo issue The_eXXe Red Hat 4 08-07-2012 04:29 AM
[SOLVED] sudo issue _spectrum_ Linux - Software 5 03-09-2011 01:09 AM
Unable to copy some files when in LiveCD - sudo nautilus pepemoko Linux - Desktop 5 08-04-2010 03:50 PM
[SOLVED] sudo issue zosty Slackware 11 06-05-2010 01:23 PM
sudo rsync -uvrlpot doesn't copy some files xpucto Linux - Newbie 1 01-15-2007 06:56 AM

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

All times are GMT -5. The time now is 10:07 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