Simple Shell Question Regarding Password Prompts
Is there a way to merge a shell command along with the required password onto one line? For example, I want to write a script to mount an sshfs point automatically if needed, but it always requests the password for the host. Is there a way to send the password along with the mount command? Thanks!
|
if you want to do sshfs properly, then use shared key authentication instead.
|
The fist time I did it, it asked to receive an RSA Key. I accepted it, but it still asks for the password (for the host machine) to connect.
|
Shared Keys
I concur.
You should always opt for shared key authentication instead of password logins. There are several malicious scripts out there that will try to brute force guess your SSH password. Those attacks will fail 100% of the time if you disable password logins and only allow shared key authentication. http://kmself.home.netcom.com/Linux/FAQs/sshrsakey.html Now a good thing by using shared keys is that you can have a key for the root account, and when you want to ssh a box while running as your user (you are running as your user aren't you!), then all you would need to do is: su -c 'ssh box_to_connect_to' Enter your local root password to be able to use the key, and then you will be logged on to the remote host without the need for a password. |
Quote:
|
All times are GMT -5. The time now is 12:05 AM. |