On Wed, Mar 3, 2010 at 3:36 PM, James Hogarth <james.hogarth@xxxxxxxxx> wrote:
Best off configuring sudo for that user (with no password) and makeOn 3 March 2010 21:20, Tim Nelson <tnelson@xxxxxxxxxxxxx> wrote:
> Greetings All-
>
> I'm about to embark on some remote management testing and need a way to login to a remote system running CentOS 4.x/5.x via SSH, su to root (using a password), then execute a command.
>
> I currently login to the boxes using key based SSH like this:
>
> ssh -i ~/remote_key admin@$REMOTEIP
>
> Then, I SU to root. However, if I try to do this automatically like this:
>
> ssh -i ~/remote_key admin@$REMOTEIP 'su -l'
>
> I'm getting:
>
> "standard in must be a tty"
>
> So, how am I able to remote login using SSH, su to root, then execute a command as root?
>
> All comments and suggestions welcome. Thanks!
>
> --Tim
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos
>
sure that user has !requiretty in the sudoers configuration.
James
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos
Does "ssh -t" help?
-- j
_______________________________________________ CentOS mailing list CentOS@xxxxxxxxxx http://lists.centos.org/mailman/listinfo/centos