Jquery中文网 www.jquerycn.cn
Jquery中文网 >  操作系统  >  linux基础  >  正文 使用ssh连接到linux

使用ssh连接到linux

发布时间:2014-07-20   编辑:www.jquerycn.cn
使用ssh连接到linux

本文介绍使用ssh连接到linux。

ssh默认的配置文件为:/etc/ssh/sshd_config
[root@kk ssh]# vim sshd_config
port=22 //端口号
permitEmptypasswords no    //禁止空密码登陆
passwordAuthentication yes  //默认使用口令模式,如果使用公匙模式则改为no

SSH使用公匙方法
passwordAuthentication yes  //改为no.需要重启

秘匙程序puttygen.exe下载地址:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

运行该程序,主界面中”Type of key generate”选择加密的算法,在”Number of bits in a generated key:”中输入加密位数,推荐默认为1024位的ssh2 RSA的加密。
Key passphrase    可为空.
Save public key   保存公匙geong.pub
Save private key  保存私匙geong.ppk
私匙geong.ppk     保存的登陆用户本机.
公匙geong.pub     保存到服务器/root/.ssh目录下,.ssh目录默认不存在,需要手工创建。

由puttyken产生的公匙文件用如下命令转换成需要的格式:
ssh-keygen -i -f /root/.ssh/geong.pub>/root/.ssh/authorized_keys

再次登陆即可实现公匙认证模式。

您可能感兴趣的文章:
25个必须记住的ssh命令
使用ssh连接到linux
避免SSH连接因超时闲置断开
实现ssh自动登录的4种方法
配置ssh,scp自动登陆
修改ubuntu ssh的默认端口
ssh,scp自动登陆方法
centos下putty连接vps
精解/etc/sshd_config配置文档
linux上ssh配置指南

[关闭]