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

Re: expect upgrade has broken my scripts



On Thu, Aug 31, 2000 at 11:34:32AM +0200, Russell Coker wrote:
> #!/usr/bin/expect
>  
> set timeout 40
> spawn ssh [lrange $argv 0 0]
> expect "$"
> send "exec su -\n"
> expect "Password: "
> send "$env(ROOTPW)\n"
> expect "#"
> send "exec bash\n"
> expect "#"
> interact

ewww this is very insecure.  you also should not be running around as
root full time, on any system.  go to root only when you need to for
as long as needed to complete the very specific task.

if you really must go to root automatically and directly you would be
better off setting PermitRootLogin to no-password and using RSA
authentication.  (possibly with ssh-agent) 

but again that is very foolish thing to do, most work need not be done
as root. 

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

Attachment: pgpKIDocVnRNd.pgp
Description: PGP signature


Reply to: