For Linux administrators that use Windows for their desktop OS, Putty is an invaluble tool. This tutorial will help you save time administering your servers without having to login to provide a username and password each time.
- Select SSH-2 RSA
- Click ‘Generate’
- Click ‘Save private key’ (you do not have enter a password)
- Save the private key in location easy to remember.
- Select all text in the public key area.
- right-click and select copy
- Open Putty
- Click Session (left column)
- Enter the server hostname or IP address
- Enter a name under ‘Saved Sessions’
- Click Connection > Data (left column)
- Enter ‘root’ for the auto-login username
- Click Connection > SSH (left column)
- Select ’2′ as the Preferred SSH protocol version.
- Click Connection > SSH > Auth (left column)
- Browse to the private key from step 4.
- Click Session (left column)
- Click Save
- Open PuTTY
- Select the session saved earlier.
- Click ‘Load’
- Click ‘Open’
- Login
- You should still have the public-key in the clip-board from step 5.
- Open the authorized_keys file on the linux server
- [root@server]#vi ~/.ssh/authorized_keys2
- Press the ‘i’ key to insert in vi.
- Go to the bottom of the file and right-click on the putty screen (This should insert the public key generated with PuTTYgen)
- Press the ‘esc’ key to get out of insert mode in vi.
- Press ‘:’ to enter command mode in vi
- Type ‘wq’ to write and quit vi
- Open PuTTY
- Select the session saved earlier.
- Click ‘Load’
- Click ‘Open’
Troubleshooting: If you do not have a /root/.ssh folder, we will have to create one and set the permissions:
[root@server]#mkdir ~/.sshIf you do not have a authorized_keys2 file, we will need to create one and set the permissions:
[root@server]#chmod 700 ~/.ssh
[root@server]#vi ~/.ssh/authorized_keys2If you get an error that the key was rejected, you need to make sure the permissions are set correctly on the .ssh directory and authorized_keys2 file.
[root@server]#chmod 644 ~/.ssh/authorized_keys2
[root@server]#chmod 700 ~/.ssh
[root@server]#chmod 644 ~/.ssh/authorized_keys2
No comments:
Post a Comment