Problem:
rsh hostname
doesn't require a password. I want ssh hostname
to work the same way, for lots of users, such as within the student.cs environment, connecting to cpuxx.cs.
There are two parts; server-side and client-side.
"Server" and "Client" are somewhat arbitrary, and could instead be "machine1" and "machine2," but this document was originally written to discuss connecting from a linux desktop to a cpuXX server. "Server" is the machine you're connecting to, "Client" the machine you're connecting from.
HostbasedAuthentication yes EnableSSHKeysign yes
ssh-keygen -tTYPE
run as root (when it prompts you for a filename, use /etc/ssh/ssh_host_TYPE_key )
Conveniently, for most cscf and math adminstered hosts, the server side has already been dealt with.
/etc/ssh/sshd_config
should enable host-based authentication:
HostbasedAuthentication yes IgnoreRhosts no
If you changed this, you must restart the ssh daemon for the changes to take effect.
/etc/ssh/ssh_host_rsa_key.pub
; linux server: /etc/ssh/ssh_known_hosts2
; solaris server: possibly: /software/ssh-openssh/data/local/ssh_known_hosts2)
/etc/hosts.equiv
(possibly already set up for rsh).
That's it.
On the client machine, run ssh -v host_machine
You should get a page of data that ends with something like:
debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased debug1: Next authentication method: hostbased debug1: Remote: Accepted for gl01.student.cs.uwaterloo.ca [129.97.152.34] by /etc/hosts.equiv. debug1: Authentication succeeded (hostbased). debug1: channel 0: new [client-session] debug1: Entering interactive session. Last login: Wed May 11 13:20:42 2005 from client_machine [etc. message of the day, & prompt]
If, instead, it ends with:
debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased debug1: Next authentication method: hostbased ssh-keysign not enabled in /etc/ssh/ssh_config ssh_keysign: no reply key_sign failed debug1: Next authentication method: publickey debug1: Trying private key: /u5/drallen/.ssh/identity debug1: Trying private key: /u5/drallen/.ssh/id_rsa debug1: Trying private key: /u5/drallen/.ssh/id_dsa debug1: Next authentication method: keyboard-interactive debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased debug1: Next authentication method: password drallen@cpu10.student.cs's password:
...you need to add the KeySign
line to /etc/ssh/ssh_config
on the client.
...similarly, ending with:
debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased debug1: Next authentication method: publickey debug1: Trying private key: /u5/drallen/.ssh/identity debug1: Trying private key: /u5/drallen/.ssh/id_rsa debug1: Trying private key: /u5/drallen/.ssh/id_dsa debug1: Next authentication method: keyboard-interactive debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased debug1: Next authentication method: password drallen@cpu10.student.cs's password:
...you need to add the HostbasedAuthentication
line on the client.
If the "Authentications that can continue:" lacks "hostbased", the server is not set up to allow hostbased authentication.
debug1: Next authentication method: hostbased debug1: Authentications that can continue: publickey,keyboard-interactive,hostbased debug1: Authentications that can continue: publickey,keyboard-interactive,hostbased debug1: No more client hostkeys for hostbased authentication. debug1: Next authentication method: publickey debug1: Trying private key: /u5/drallen/.ssh/identity debug1: Trying private key: /u5/drallen/.ssh/id_rsa debug1: Trying private key: /u5/drallen/.ssh/id_dsa debug1: Next authentication method: keyboard-interactive Password:
"No more client hostkeys for hostbased authentication" suggests that either end of the connection was having trouble looking up the reverse IP of the client and matching it against the key.
Hope this helps!
...some of this information came from 'man ssh' and other parts from the Open SSH quick reference: http://tiger.la.asu.edu/Quick_Ref/OpenSSH_quickref.pdf
While you're editing sshd_config and ssh_config, you might want to enable X Forwarding.
In sshd_config, you'll need X11Forwarding yes
If you want to make X Forwarding turned on by default for outgoing connections, in ssh_config you'll need ForwardX11Trusted yes
(for OpenSSH 3.8 and above) or ForwardX11 yes
(for older OpenSSH versions)
See http://www.cs.uwaterloo.ca/cscf/howto/ssh/ForwardX11.shtml for more details.
-- DanielAllen - 11 May 2005
I found I had to install xauth
in order for sshd
to set up the proxying. It appears sshd
runs xauth
to update ~/.Xauthority
before setting the DISPLAY
environment variable.
-- IlguizLatypov - 22 Aug 2007
If you need to collect a bunch of public keys into the ssh_known_hosts file on the server side, you can also do this using ssh-keyscan.
-- ChristopherCalzonetti - 19 Feb 2009