Chinaunix首页 | 论坛 | 博客
  • 博客访问: 41195
  • 博文数量: 10
  • 博客积分: 1720
  • 博客等级: 上尉
  • 技术积分: 115
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-04 16:31
文章分类
文章存档

2013年(1)

2012年(6)

2011年(3)

我的朋友

分类: 系统运维

2012-11-27 13:24:39

Generally speaking, there is only three setps in setting up automatically SSH login:
1. Generate public and private key for automatic login on the client.
2. Import Public key to the server.
3. Enable Public key authentication for SSH on the server.

1. Automatically SSH login to Solaris 11.1 from a Windows Client
Preparation:
Please download Putty, PuTTYgen and Pageant from Here:
Generate public and private key for automatic login on the client:
Lanuch the PuTTYgen application :
Default key generation parameters are fine to use. Generally SSH-2 RSA keys at 1024 or 2048 bit encryption is recommended. 
Click 'Generate'. You will then need to move the cursor around a bit to generate randomness:
Save your private key. Before you click “Save private key”, I recommended you select a passphrase for better security. Otherwise, other people with access to your private key can use it freely:
Copy and save the public key as "authorized_keys" manually. ( The public key saved by clicking "Save public key" used a different style which will cause server to refuse your private key)

Import Public key to the server:
Login in to your Solaris 11.1 server either locally or remotely through SSH and copy                  "authorized_keys" to your ".ssh" folder :

点击(此处)折叠或打开

  1. mkdir ~/.ssh
  2. cp authorized_keys ~/.ssh/
  3. chmod 700 ~/.ssh
  4. dhmod 600 ~/.ssh/authorized_keys
Make sure sshd service is online:

点击(此处)折叠或打开

  1. svcs ssh
  2. STATE STIME FMRI
  3. online 15:49:10 svc:/network/ssh:default
If not online:

点击(此处)折叠或打开

  1. sudo svcadm enable svc:/network/ssh:default
Since Solaris 11.1 has enabled Public key authentication by default, the configurations on server side is done.

Prepare windows client to be ready for automatically SSH login:
 Lanuch Pageant application:
Click "Add Key" to add the private key saved previously, if you added a passphrase for the private key, you will be prompted to enter the passphrase. 

Use putty to login:

点击(此处)折叠或打开

  1. d:\App\PuTTY\putty.exe deamen@192.168.1.103
The server won't ask you  for password any more, as long as Pageant is running in the background.

Further more:
To launch Pageant and load your private key each time windows startup:
Create a file named "AutoPageant.cmd" with the following command:

点击(此处)折叠或打开

  1. D:\App\PuTTY\pageant.exe d:\ssh_key\private.ppk
Put "AutoPagent.cmd" into your startup folder and then reboot. 



阅读(801) | 评论(0) | 转发(0) |
0

上一篇:VirtualBox

下一篇:传统的工程师精神

给主人留下些什么吧!~~