[Gllug] Passwordless SSH
James McGuigan
james at worldfuturecouncil.org
Wed Aug 24 22:02:25 UTC 2005
I have a ubuntu box in my office behind a NAT firewall and I can't get port
forwarding or a static IP assigned to the box.
I have managed to successfully establish a reverse ssh connection to my home system via:
ssh -nNT -R 2222:localhost:22 user at my.home.machine
and I can ssh back from my home machine by
ssh localhost -p 2222
However to establish the reverse ssh connection, requires I enter in a password
manually. To automatically enter the password I've tried
(sleep 5s && echo $password) | ssh -nNT -R 2222:localhost:22 user at my.home.machine
but ssh complains "Pseudo-terminal will not be allocated because stdin is not a
terminal."
Is there any way of tricking ssh or other programs into thinking its running from a
terminal when its not?
The machine occasionally gets switched off (its a desktop machine) and I'm rarely in
the office physically, so manually setting up a connection each time is not that
feasible (and I can't remotely log in each time I need to set it up for obvious
reasons :-) ).
In short I need a method of either passing the password in a script to ssh, or
pre-configuring ssh on both ends to accept the connection without asking for a
password. man ssh alludes to this possibility, but I haven't been able to figure out
which keys I need to locate and where or where to put or copy them.
--
Rules are written for those who lack the ability to truly reason,
But for those who can, rules become nothing more than guidelines,
And live their lives governed not by rules but by reason.
- James McGuigan
Earth Emergency - A Call to Action (www.earthemergency.org)
Sustainable Society Directory (www.sustainable-society.co.uk)
World Future Council Initiative (www.worldfuturecouncil.org)
Open co-op (http://open.coop)
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list