PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : آموزشی SSH passwordless login with putty



آبجی
10th March 2010, 01:02 PM
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.


Click on image for play tutorial:

http://web.persianadmins.com/passwordless-putty.jpg (http://web.persianadmins.com/puttypasswordless.html)

1. Download PuTTY

2. Download PuTTYgen

3. Open PuTTYgen
* Select SSH-2 RSA
* Click ‘Generate’

4. Save the Private Key
* Click ‘Save private key’ (you do not have enter a password)
* Save the private key in location easy to remember.

5. Copy public-key
* Select all text in the public key area.
* right-click and select copy

6. Configure the server settings in Putty
* Open Putty
* Click Session (left column)
o Enter the server hostname or IP address
o Enter a name under ‘Saved Sessions’
* Click Connection > Data (left column)
o Enter ‘root’ for the auto-login username
* Click Connection > SSH (left column)
o Select ‘2′ as the Preferred SSH protocol version.
* Click Connection > SSH > Auth (left column)
o Browse to the private key from step 4.
* Click Session (left column)
o Click Save

7. Open a session with the server
* Open PuTTY
* Select the session saved earlier.
* Click ‘Load’
* Click ‘Open’
* Login

8. Add client public key.
* You should still have the public-key in the clip-board from step 5.
* Open the authorized_keys file on the linux server
o [root@server]#vi ~/.ssh/authorized_keys2
o Press the ‘i’ key to insert in vi.
o Go to the bottom of the file and right-click on the putty screen
(This should insert the public key generated with PuTTYgen)
o Press the ‘esc’ key to get out of insert mode in vi.
o Press ‘:’ to enter command mode in vi
o Type ‘wq’ to write and quit vi

9. Now, you should be finished. Let’s test.
* Open PuTTY
* Select the session saved earlier.
* Click ‘Load’
* Click ‘Open’

10. If you were able to login without entering your username and password you are finished!!If not, please continue to troubleshoot.

Troubleshooting:

If you do not have a /root/.ssh folder, we will have to create one and set the permissions



[root@server]#mkdir ~/.ssh
[root@server]#chmod 700 ~/.ssh



If you do not have a authorized_keys2 file, we will need to create one and set the permissions:

[root@server]#vi ~/.ssh/authorized_keys2

[root@server]#chmod 644 ~/.ssh/authorized_keys2


If 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 700 ~/.ssh

[root@server]#chmod 644 ~/.ssh/authorized_keys2

استفاده از تمامی مطالب سایت تنها با ذکر منبع آن به نام سایت علمی نخبگان جوان و ذکر آدرس سایت مجاز است

استفاده از نام و برند نخبگان جوان به هر نحو توسط سایر سایت ها ممنوع بوده و پیگرد قانونی دارد