jeudi 27 mars 2008

ssh authentication on debian

clipped from www.howtoforge.com

How To Set Up SSH With Public-Key Authentication On Debian Etch

Preparations On Our Client (Desktop) System

apt-get install openssh-client


mkdir ~/.ssh
chmod 700 ~/.ssh
cd ~/.ssh

ssh-keygen -t rsa -C "A comment... usually an email is enough here..."

scp -p id_rsa.pub remoteuser@remotehost:

ssh remoteuser@remotehost
mkdir ~/.ssh
chmod 700 ~/.ssh
cat id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
mv id_rsa.pub ~/.ssh
logout

rm id_rsa.pub

ssh remoteuser@remotehost

cd /etc/ssh
cp sshd_config sshd_config.orig
nano sshd_config

/etc/init.d/ssh restart

Be careful: if you disable password authentication, then you won't be able to log in with passwords! Only key-based authentication will be available!

 blog it

Aucun commentaire: