Search: Home Bugtraq Vulnerabilities Mailing Lists Jobs Tools Beta Programs
Secure Shell
remote scp command Sep 25 2009 10:51AM
Jurgen Lamsens (jurgen lamsens telenet be) (2 replies)
Re: remote scp command Sep 25 2009 08:56PM
Greg Wooledge (wooledg eeg ccf org)
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 (at) 192.168.155 (dot) 187 [email concealed]:/root/
> jlamsens (at) 192.168.155 (dot) 187 [email concealed]'s password:
> scp: /root//file.txt: Permission denied

The easy way would be:

scp file.txt root (at) 192.168.155 (dot) 187 [email concealed]:/root/

The harder way would be something like:

ssh jlamsens (at) 192.168.155 (dot) 187 [email concealed] 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.

[ reply ]
RE: remote scp command Sep 25 2009 02:02PM
Males, Jess (jmales cio sc gov)







 

Privacy Statement
Copyright 2009, SecurityFocus