Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, Anyone please help me on this, please share the syntax for scp with sudo user or sudo. if,not kindly share alternate solution for this issue . Thanks Rajesh...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    5

    How to SCP with sudo user


    Hi,
    Anyone please help me on this,

    please share the syntax for scp with sudo user or sudo.


    if,not kindly share alternate solution for this issue .

    Thanks
    Rajesh

  2. #2
    Just Joined!
    Join Date
    Mar 2011
    Posts
    67
    Do you mean coping a file that root owns?

    Normally you would just specify root as the user but Ubuntu disables directly logging into root by default.
    So you can log into the machine with the files you want to copy (remotely if you have to) as a regular user and then run the following:

    Code:
    ~$ sudo su
    ~$ scp /source/file user@10.0.0.2:/my/destination
    ~$ exit
    that will let you become root, copy files to the machine at 10.0.0.2, and then drop root privileges

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •