1.现在服务器上生成密钥(会生成两个文件一个公钥一般以.pub结尾,一个私钥)
命令:ssh-keygen -t rsa
建议生成的私钥一定要有密码,这样私钥丢失,别人没有密码也没法使用私钥
2. 找到生成的密钥文件(这个文件一般在/home/.ssh下或者是/root/.ssh)
3. 把生成的公钥写入到用户家目录下的 .ssh/authorized_keys 内
命令:cat 公钥文件名 >> .ssh/authorize_keys (路径写全)
- 把私钥发送给需要的连接服务器的人
- 修改/etc/ssh/sshd_config文件
#开启用户使用成对密钥登陆的权限
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
#为了安全把密码验证登陆禁用掉
PasswordAuthentication no
- Widows系统可以通过远程软件连接(以Xshell为例)
- 打开Xshell 工具,选择用户密钥管理,选择导入,然后按照引导引导步骤操作即可
- 测试连接可行性,用户验证使用Public key验证,选择刚导入的密钥
Is this really useful?
Make thousands every week working online here.
Link – http://1c-met.ru/bitrix/rk.php?id=2&event1=banner&event2=click&goto=https://hdredtube3.mobi/btsmart
Thank you!!1
I have to thank you for the efforts you’ve put in writing this blog.
I really hope to view the same high-grade blog posts by you
in the future as well. In truth, your creative writing
abilities has inspired me to get my own blog
now 😉