$mkdir ~/.ssh
$chmod 700 ~/.ssh
$cd ~/.ssh
$ssh-keygen -t rsa -C "id_rsa"
$scp -p id_rsa.pub remoteuser@remotehost
$ssh remoteuser@remotehost
$mkdir ~/.ssh
$chmod 700 ~/.ssh
IMPORTANT : You need to edit the authorized_keys on the right user, if you need to allow multiple user, you need to edit all “.ssh\authorized_keys” under all users !!
$touch ~/.ssh/authorized_keys
$cat id_rsa.pub >> ~/.ssh/authorized_keys
$chmod 600 ~/.ssh/authorized_keys
Here i use webmin
$chmod -R 600(or 700 ?) id_rsa.priv.txt
$ssh -i id_rsa.priv root@IP
Source : sourceforge
$/bin/rm -v /etc/ssh/ssh_host_*
$dpkg-reconfigure openssh-server
$systemctl restart ssh
$ssh-keygen -R IP_of_your_server
$nano /etc/issue
$nano /etc/motd
$nano etc/issue
escape sequences : \b -- Baudrate of the current line. \d -- Current date. \s -- System name, the name of the operating system. \l -- Name of the current tty line. \m -- Architecture identifier of the machine, eg. i486 \n -- Nodename of the machine, also known as the hostname. \o -- Domainname of the machine. \r -- Release number of the OS, eg. 1.1.9. \t -- Current time. \u -- Number of current users logged in. \U -- The string "1 user" or " users" where is the number of current users logged in. \v -- Version of the OS, eg. the build-date etc.
For example :
If “/etc/issue” file contain “Debian GNU/Linux \d”
Output look like :
Debian GNU/Linux Web Feb 22 2017
Source : cyberciti