223
Chapter 15: Advanced Configuration
OpenSSHauthorized_keysle"sectionofthePuTTYKeyGenerator,andpastethekeydatatothe"authorized_keys"le.
Make sure there is only one line of text in this file
• UseWinSCPtocopythis"authorized_keys"leintotheuser’shomedirectory:eg./etc/cong/users/testuser/.ssh/
authorized_keys of the Console Server which will be the SSH server. You will need to make sure this file is in the correct
format with the correct permissions with the following commands:
# dos2unix \
/etc/config/users/testuser/.ssh/authorized_keys && chown testuser \
/etc/config/users/testuser/.ssh/authorized_keys
• UsingWinSCPcopytheattachedsshd_congover/etc/config/sshd_configontheserver(Makessurepublickey
authenticationisenabled)
• TestthePublicKeybylogginginas"testuser"TestthePublicKeybylogginginas"testuser"totheclientConsoleServer
deviceandtyping(youshouldnotneedtoenteranything):#ssh-oStrictHostKeyChecking=no<server-ip>
ToautomateconnectionoftheSSHtunnelfromtheclientoneverypower-upyouneedtomaketheclients /etc/config/rc.local
look like the following:
#!/bin/sh
ssh -L9001:127.0.0.1:4001 -N -o StrictHostKeyChecking=no testuser@<server-ip> &
Thiswillrunthetunnelredirectinglocalport9001totheserverport4001.
15.6.6 Fingerprinting
FingerprintsareusedtoensureyouareestablishinganSSHsessiontowhoyouthinkyouare.Ontherstconnectiontoa
remote server you will receive a fingerprint which you can use on future connections.
This fingerprint is related to the host key of the remote server. Fingerprints are stored in ~/.ssh/known_hosts.
Toreceivethengerprintfromtheremoteserver,logintotheclientastherequireduser(usuallyroot)andestablisha
connection to the remote host:
# ssh remhost
The authenticity of host 'remhost (192.168.0.1)' can't be established.
RSA key fingerprint is 8d:11:e0:7e:8a:6f:ad:f1:94:0f:93:fc:7c:e6:ef:56.
Areyousureyouwanttocontinueconnecting(yes/no)?