Re: remote scp command
- From: Greg Wooledge <wooledg@xxxxxxxxxxx>
- Date: Fri, 25 Sep 2009 16:56:39 -0400
On Fri, Sep 25, 2009 at 12:51:44PM +0200, Jurgen Lamsens wrote:
3.) I want to scp to a directory that I do not have access to, but I
cannot give some kind of sudo parameter to scp:
jlamsens@ubuntu1:~$ scp file.txt jlamsens@xxxxxxxxxxxxxxx:/root/
jlamsens@xxxxxxxxxxxxxxx's password:
scp: /root//file.txt: Permission denied
The easy way would be:
scp file.txt root@xxxxxxxxxxxxxxx:/root/
The harder way would be something like:
ssh jlamsens@xxxxxxxxxxxxxxx sudo sh -c '"cat > /root/file.txt"' < file.txt
But this requires a no-password-given sudoer permission on 192.168.155.187
because even if you allocate a pseudo-terminal with "ssh -t", you're
still using the stdin stream for data, so sudo can't use it to ask you
for your password.
- References:
- remote scp command
- From: Jurgen Lamsens
- remote scp command
- Prev by Date: Protecting a file in internal-sftp jail (chroot)
- Next by Date: Re: Protecting a file in internal-sftp jail (chroot)
- Previous by thread: remote scp command
- Next by thread: RE: remote scp command
- Index(es):