Find the answer to your Linux question:
Results 1 to 4 of 4
I am tryng to use "scp" to copy files from one machine to the other, but i can store files on the other machine only by using the "sudo" command. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2006
    Posts
    14

    Help needed urgently!!!


    I am tryng to use "scp" to copy files from one machine to the other, but i can store files on the other machine only by using the "sudo" command.
    I am using the following syntax, but this gives errors:

    sudo scp filename username@machine:/filename

    Error: permission denied

    So i try using the sudo command for the second machine

    sudo scp filename sudo username@machine:/filename

    Error: scp: /filename: No such file or directory

    Any suggestions.

    I think there is some problem with the positioning of the sudo comand

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,915
    It should be as simple as:

    Code:
    scp <filename> username@machine:~/filename
    which will dump the file in the home directory of the user specified by "username".
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Jan 2006
    Posts
    14
    yeah, that command works. But my question was more about the sudo command

  4. $spacer_open
    $spacer_close
  5. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,915
    Quote Originally Posted by chinmays
    yeah, that command works. But my question was more about the sudo command
    Once the file is on the target machine, you can use regular ssh to log in and move the file, using sudo if needed, to wherever you intended to put it.
    Linux user #126863 - see http://linuxcounter.net/

Posting Permissions

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