Re: scp with tty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Les Mikesell wrote:
> 
> I'm still missing why you'd need to sudo inside the remote shell instead 
> of ssh'ing as the right user in the first place.  

Perhaps he doesn't know the user@ syntax.

Tony, try this:

	[localuser@host1 ~]$ ssh root@host2 remotecmd

This requires that the public key for localuser on host1 exists in 
host2:.ssh/authorized_keys.  It also requires "PermitRootLogin yes" in 
/etc/ssh/sshd_config, which is unfortunately the default on CentOS.  (I 
usually turn it off.)

Beware that this makes localuser on host1 equivalent to root on host2!

Also realize that remotecmd can be a very complex thing, not just a 
simple command.  You can use pipes and other things through ssh.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux