安装完centos系统后,在vmware里面操作是很不方便的,这时候我们可以用SecureCRT这个工具来实现我们多任务窗口工作。
一般操作系统安装都会自带安装openssh-server,如果没安装,请自行安装。
本文主要是通过ssh2协议来连接:连接方式:1密码连接,2 RSA非对称密钥连接
[color=blue]1 密码连接[/color]
sshd配置如下:
[quote]Port 22
Protocal 2
[/quote]
最后重启sshd服务
SecureCRT配置
[img]http://dl2.iteye.com/upload/attachment/0106/3047/8992c40d-7f97-3745-9a9b-c34d89fb1ad8.png[/img]
连接成功后如下:
[img]http://dl2.iteye.com/upload/attachment/0106/3049/5a124541-cfbf-3d24-8ed7-d4ad666e8010.png[/img]
如果要按原unix颜色方案,如下设置
[img]http://dl2.iteye.com/upload/attachment/0106/3305/6bb9685d-75a6-30b4-aeea-3cd788c03b02.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0106/3051/10347a01-e3de-30f5-804c-9aeae37c85d4.png[/img]
[color=blue]2 RSA连接[/color]
sshd配置如下:
[quote]Port 22
Protocal 2
RSAAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no
[/quote]
如果你没发现.ssh目录,你可以自己mkdir创建;也可以执行下面指令,随意输入no后,系统会自动生成。
cd ~/.这时可以看到.ssh目录
SecureCRT生成密钥步骤:
1
[img]http://dl2.iteye.com/upload/attachment/0106/3055/f1e3b27d-ab74-3dd2-bbc9-df2521dc89a9.png[/img]
2
[img]http://dl2.iteye.com/upload/attachment/0106/3057/01da3e42-570b-3e1f-8a5b-b11c6358f51a.png[/img]
3
[img]http://dl2.iteye.com/upload/attachment/0106/3059/5663feaa-6680-30d1-9178-36c3793a72fe.png[/img]
4
[img]http://dl2.iteye.com/upload/attachment/0106/3061/43674f77-f029-3309-9807-e50e61faf5e3.png[/img]
5注意这里key有两种格式:standard和openssh。不同的格式,后面将key导入authorized_keys文件中方法不同
[img]http://dl2.iteye.com/upload/attachment/0106/3063/017fa309-9829-390d-aea5-2c7cac87e462.png[/img]
6将刚才生成的Identify.pub传到linux ~/.ssh目录下
[img]http://dl2.iteye.com/upload/attachment/0106/3067/08a240b6-838c-3fcc-9a97-28cd83fe8b1b.png[/img]
7 导入Identify.pub到authorized_keys
[img]http://dl2.iteye.com/upload/attachment/0106/3069/934bb1e8-065d-3953-b310-0417845b2705.png[/img]
8
[img]http://dl2.iteye.com/upload/attachment/0106/3071/e54da4d8-7f3c-3feb-a64e-83823d9bfdce.png[/img]
9
[img]http://dl2.iteye.com/upload/attachment/0106/3073/19efe195-df62-3f05-b4ad-503fe66ab2e5.png[/img]
10
[img]http://dl2.iteye.com/upload/attachment/0106/3075/65eaa1e2-0112-3ecd-b456-44c03fe1608a.png[/img]
一般操作系统安装都会自带安装openssh-server,如果没安装,请自行安装。
本文主要是通过ssh2协议来连接:连接方式:1密码连接,2 RSA非对称密钥连接
[color=blue]1 密码连接[/color]
vi /etc/ssh/sshd_config
sshd配置如下:
[quote]Port 22
Protocal 2
[/quote]
最后重启sshd服务
service sshd restart
SecureCRT配置
[img]http://dl2.iteye.com/upload/attachment/0106/3047/8992c40d-7f97-3745-9a9b-c34d89fb1ad8.png[/img]
连接成功后如下:
[img]http://dl2.iteye.com/upload/attachment/0106/3049/5a124541-cfbf-3d24-8ed7-d4ad666e8010.png[/img]
如果要按原unix颜色方案,如下设置
[img]http://dl2.iteye.com/upload/attachment/0106/3305/6bb9685d-75a6-30b4-aeea-3cd788c03b02.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0106/3051/10347a01-e3de-30f5-804c-9aeae37c85d4.png[/img]
[color=blue]2 RSA连接[/color]
sshd配置如下:
[quote]Port 22
Protocal 2
RSAAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no
[/quote]
如果你没发现.ssh目录,你可以自己mkdir创建;也可以执行下面指令,随意输入no后,系统会自动生成。
ssh -l root 192.168.7.224
cd ~/.这时可以看到.ssh目录
SecureCRT生成密钥步骤:
1
[img]http://dl2.iteye.com/upload/attachment/0106/3055/f1e3b27d-ab74-3dd2-bbc9-df2521dc89a9.png[/img]
2
[img]http://dl2.iteye.com/upload/attachment/0106/3057/01da3e42-570b-3e1f-8a5b-b11c6358f51a.png[/img]
3
[img]http://dl2.iteye.com/upload/attachment/0106/3059/5663feaa-6680-30d1-9178-36c3793a72fe.png[/img]
4
[img]http://dl2.iteye.com/upload/attachment/0106/3061/43674f77-f029-3309-9807-e50e61faf5e3.png[/img]
5注意这里key有两种格式:standard和openssh。不同的格式,后面将key导入authorized_keys文件中方法不同
[img]http://dl2.iteye.com/upload/attachment/0106/3063/017fa309-9829-390d-aea5-2c7cac87e462.png[/img]
6将刚才生成的Identify.pub传到linux ~/.ssh目录下
cd ~/.ssh
rz
[img]http://dl2.iteye.com/upload/attachment/0106/3067/08a240b6-838c-3fcc-9a97-28cd83fe8b1b.png[/img]
7 导入Identify.pub到authorized_keys
如果key是standard方式生成的,执行下面指令
ssh-keygen -i -f Identity.pub >> authorized_keys
如果你的key是openssh方式生成的,执行下面指令
cat Identify.pub >> authorized_keys
完成后,重启ssh服务
service sshd restart
[img]http://dl2.iteye.com/upload/attachment/0106/3069/934bb1e8-065d-3953-b310-0417845b2705.png[/img]
8
[img]http://dl2.iteye.com/upload/attachment/0106/3071/e54da4d8-7f3c-3feb-a64e-83823d9bfdce.png[/img]
9
[img]http://dl2.iteye.com/upload/attachment/0106/3073/19efe195-df62-3f05-b4ad-503fe66ab2e5.png[/img]
10
[img]http://dl2.iteye.com/upload/attachment/0106/3075/65eaa1e2-0112-3ecd-b456-44c03fe1608a.png[/img]