Re: ssh and su
- From: GaGadget <GaGadgetNOSP@xxxxxxxx>
- Date: Tue, 28 Mar 2006 01:24:56 +0200
GaGadget wrote:
Kimmo Koivisto wrote:
GaGadget wrote:
I would like to be able to launch command as root on distant machines
using ssh.
Any idea or tips on that one ?
I would do this using sudo instead of su.
1. create user1 to the remote machine
2. define commands that user1 can execute as root to the /etc/sudoers
<example entry to the sudoers file>
user1 ALL=NOPASSWD:/sbin/iptables
</example>
Unfortunatly, I am not allowed to use sudo ...
3. execute command as root using ssh
#ssh user1@xxxxxxx "sudo -u root /sbin/iptables -L -n"
<no root password needed>
4. to execute ssh without user1's password, create RSA/DSA-keys for you
and store public part to the /home/user1/.ssh/authorized_keys to the
foo.bar machine
Yes, I'll do that for preventing the user1 password prompt.
Regards
Kimmo Koivisto
I will try to use "-t" with the ssh command as suggested by Darren on an
other post.
"su" seems to need a real pseudo-tty and the "-t" force the allocation of
a pseudo-tty not allocated by default when ssh is used force launching
remote command.
Thank you for the complete answer guys.
Gaga.
It works great !
Thank you,
Regars.
.
- References:
- ssh and su
- From: GaGadget
- Re: ssh and su
- From: Kimmo Koivisto
- Re: ssh and su
- From: GaGadget
- ssh and su
- Prev by Date: Re: key auth ok one way, not the other
- Next by Date: Re: key auth ok one way, not the other
- Previous by thread: Re: ssh and su
- Next by thread: Tectia 5 Certificate Authentication
- Index(es):
Relevant Pages
|
|