1, make sure the sshd service is installed on system.
service sshd status
2, create public/private key pairs:
ssh-keygen # answer with default value.
3, now private and public key pairs are created as OpenSSH format.
if we use other client tool not ssh program (such as secureCRT,PUTTY)
We must first have a clear concept about the public key format.
In fact, Linux use OpenSSH format ,however Others (windows remote client tools)
use SECSH file format. So if we want use other tool connect to Linux SSHD server,
we should convert public key file from OpenSSH format to SECSH format.
Do it like this:
ssh-keygen -e -f id_rsa > id_rsa1.pub # or like following get the same result.
ssh-keygen -e -f id_rsa.pub > id_rsa1.pub
4, transfer to client . we can use sz/rz tool achieve this.Here we assume you have connected to server by Telnet client tool(secureCRT).
sz id_rsa1.pub
5, add the authorized public key:
cat id_rsa.pub >> authorized_keys
6, configure client tool select ssh2 tool, prioritize "public key" as the first authenticate method.
select the file received from sz( id_rsa1.pub) .
7, try to connect to server. Good Luck !
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/350519/viewspace-1034524/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/350519/viewspace-1034524/
本文详细介绍如何在Linux系统上配置SSH公钥认证,包括安装SSH服务、创建公私钥对、转换公钥格式以适应不同客户端工具、传输密钥文件、配置客户端工具并进行连接测试等步骤。
1006

被折叠的 条评论
为什么被折叠?



