f



transfer file to system directory thru ssh.

Hi,

I need remotely transfer some system configuration files to the /etc and 
/usr/local/etc directory. I could configure ssh user account with public 
key installed, the transfer will be started withiout asking the password.

But since the ssh account is not a root account, it does not have 
permission copy the file to system directory. How can I configure the 
system allow this  ssh account copy file to system directory without 
modifying the file system permission?


Thanks
Sam
0
sam
5/2/2005 5:51:34 AM
comp.unix.bsd.openbsd.misc 3191 articles. 1 followers. Post Follow

2 Replies
499 Views

Similar Articles

[PageSpeed] 12

sam wrote:
> Hi,
> 
> I need remotely transfer some system configuration files to the /etc and
> /usr/local/etc directory. I could configure ssh user account with public
> key installed, the transfer will be started withiout asking the password.
> 
> But since the ssh account is not a root account, it does not have
> permission copy the file to system directory. How can I configure the
> system allow this  ssh account copy file to system directory without
> modifying the file system permission?
> 
> 
> Thanks
> Sam


  Well, the real proble is: you have to be able to act as root on the
remote system without supplying a password.
  So if you don't want to directly ssh as root, you can try to add to
/etc/sudoers (on the remote machine) the following line (I'm not 100%
sure about the syntax, you better read the man on "sudoers"):

sam ALL = NOPASSWD: /bin/tar

  And from the local system you do something like the following:

tar -cz /etc | ssh -l sam remote_system "cd / ; sudo tar -xz"

Hope this helps,
Mihai
0
Mihai
5/2/2005 6:20:24 PM
Mihai Osian wrote:
> sam wrote:
> 
>>Hi,
>>
>>I need remotely transfer some system configuration files to the /etc and
>>/usr/local/etc directory. I could configure ssh user account with public
>>key installed, the transfer will be started withiout asking the password.
>>
>>But since the ssh account is not a root account, it does not have
>>permission copy the file to system directory. How can I configure the
>>system allow this  ssh account copy file to system directory without
>>modifying the file system permission?
>>
>>
>>Thanks
>>Sam
> 
> 
> 
>   Well, the real proble is: you have to be able to act as root on the
> remote system without supplying a password.
>   So if you don't want to directly ssh as root, you can try to add to
> /etc/sudoers (on the remote machine) the following line (I'm not 100%
> sure about the syntax, you better read the man on "sudoers"):
> 
> sam ALL = NOPASSWD: /bin/tar
> 
>   And from the local system you do something like the following:
> 
> tar -cz /etc | ssh -l sam remote_system "cd / ; sudo tar -xz"
> 
Thanks,that's probably the simplest form of solution I can go along with 
initially. If a simple configuration of ACL/MAC can handle this easily, 
I would probably go for that in the near future.

Thanks
Sam
> Hope this helps,
> Mihai
0
sam
5/3/2005 2:51:47 AM
Reply: