In this article, we will guide you to use SSH key instead of username and password to ssh into Mikrotik router device.
– To create Private and Public Key, in this example we will use the Putty Key Generator tool available in Putty software.
– Select Generate to create a Private and Public Key pair, select Save to save, for Public Key save with .pub extension
– Copy the Public Key file to the Mikrotik device.
– Go next System -> Usersin the SSH Keys tab, select Import SSH keysand select the uploaded Public Key file and the User using this key, in this example admin -> Import SSH keys.
– Now to SSH into the device we must use the Private Key, in putty to use the Key, go to SSH -> Authselect the Private Key file.
– If you log in with user/password, the device will deny access. If you want to log in with both user/password, use the command below to allow.
!!! Thank you for following the article!!!
Xem tiếp...