From: Brian Candler Date: 2003-04-13T18:38:19+09:00 Subject: Re: Controlling an interactive program from Ruby On Sun, Apr 13, 2003 at 05:06:42PM +0900, Mauricio Fern?ndez wrote: > > >>>Passwords are unsafe.. take a look at ssh-keys. > > The reasons given before don't hold IMHO, as > * no plaintext is used > * whoever gets access to the script w/ the password inside can > equally get the files in ~/.ssh/ and steal the key file > * if you cannot trust the computer you're using you're screwed anyway. > If "they" have a keystroke recorder, "they" can as well just copy your key > files. Or they could have a modified ssh binary that saves everything > it receives somewhere, or... > > There's however one (IMO) valid reason: passwords tend to be weak and > can be "easily" guessed. The passphrase on an ssh key tends to be equally weak (or totally non-existent, if Daniel's running ssh with RSA/DSA but empty passphrase). It's almost as bad as having a script with a password hard-coded in it. However you can use a feature in .ssh/authorized_keys which lets you say that a particular key is only usable from a certain IP address, and/or only for running a particular command. Otherwise, the main difference is that only a public key is stored on the server side, not an encrypted password. If someone breaks into the server, they can't do a dictionary attack against a public key. There are lots of other side-benefits to RSA/DSA authentication though - for example being able to use the same key on lots of systems without any security drawbacks, and being able to change the passphrase on your private key whenever you like without having to log into all those systems. Strongly recommended. Regards, Brian.