Automate SSH?

MorgUK

New Member
Is there anyway to automate SSH login? I'm tired of going onto putty and entering login details then SU. Does anyone have a better way to do this? I feel like I've wasted a lot of time entering those details, especially if the connection is lost I've got to put it all back in.
 

Quags

Administrator
Staff member
Sounds like you are looking for SSH keys.

This allows a connection with out a password using a special key. Since you are using putty the process is outlined at: http://linux-sxs.org/networking/openssh.putty.html

On the side you are sshing to, create the key with

ssh-keygen -b 2048 -t rsa

You can enter a password to have a password on the key, or hit enter twice to have no passphrase.
 

Yanz

New Member
Once you have a key you can set it up to be used in putty, then from the saved list all you need to do is double click on the server you wish to connect to, and it will do the rest for you.
 

nonsiccus

New Member
You should be able to save profiles in Putty. Assuming you have the credentials and key, you should be able to just punch it all in to the client and save so that you don't need to re-enter it on subsequent connections.
 

MorgUK

New Member
Ah right! Cheers for that guys, I'll have a more in-depth look at Putty and report back with my results.
 

nonsiccus

New Member
Ah right! Cheers for that guys, I'll have a more in-depth look at Putty and report back with my results.
MorgUK - I'm not sure if you'll find this useful, but I read somewhere else on the forum that someone was suggesting to use KiTTY, which is a fork of the PuTTY development. This means that it will contain the same core feature set, but will have the freedom to develop how they wish from that common point.

You can get it here, http://kitty.9bis.net/ and check it out. I've spent a little bit of time with it since I heard about it and am liking it so far. Also, the name is just way better ;)
 

Joe Huss

Administrator
Staff member
In addition to that if you use KiTTY it supports connection 'scripts'
Basically they look something like:

Wait for Username:
Send "myusername"
Wait for Password:
send "iamcool"
Wait for #
send "df -h"

so you can program in both the password being sent and something you might want to run after the connection.


I would suggest using ssh keys over passwords anyways, more convenient and generally more secure.
 

Quags

Administrator
Staff member
In addition to that if you use KiTTY it supports connection 'scripts'
Basically they look something like:

Wait for Username:
Send "myusername"
Wait for Password:
send "iamcool"
Wait for #
send "df -h"

so you can program in both the password being sent and something you might want to run after the connection.


I would suggest using ssh keys over passwords anyways, more convenient and generally more secure.
Much more secure in fact. With ssh keys you can

client side
* never send your actual password
* can be protected with a pass phrase before use

server side
* allows for the ability to disable password auth completely (no brute force)
* ssh key can be permitted from particular ips only
 
Top