使用ssh-keygen生成私钥和公钥
来源:互联网 发布:json格式验证工具 编辑:程序博客网 时间:2024/05/22 03:31
1.使用ssh-keygen生成私钥和公钥
命令如下:
ssh-keygen -t rsa
例子:
fdipzone@ubuntu:~$ ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/fdipzone/.ssh/id_rsa): 这里输入要生成的文件名Enter passphrase (empty for no passphrase): 这里输入密码 Enter same passphrase again: 这里重复输入密码Your identification has been saved in /home/fdipzone/.ssh/id_rsa.Your public key has been saved in /home/fdipzone/.ssh/id_rsa.pub.The key fingerprint is:f2:76:c3:6b:26:10:14:fc:43:e0:0c:4d:51:c9:a2:b0 fdipzone@ubuntuThe key's randomart image is:+--[ RSA 2048]----+| .+=*.. || . += + || o oo+ || E . . o || ..S. || .o . || .o + || ...oo || +. |+-----------------+
参数 -t rsa 表示使用rsa算法进行加密,执行后,会在/home/当前用户/.ssh目录下找到id_rsa(私钥)和id_rsa.pub(公钥)
fdipzone@ubuntu:~$ ls -lt ~/.ssh总用量 12-rw------- 1 fdipzone fdipzone 1679 2015-08-07 00:28 id_rsa-rw-r--r-- 1 fdipzone fdipzone 397 2015-08-07 00:28 id_rsa.pub
也可以使用 dsa 加密算法进行加密,命令如下:
ssh-keygen -t dsa
2.设定客户端连接使用的ssh私钥和公钥
vim /etc/ssh/ssh_config
找到
# IdentityFile ~/.ssh/identity# IdentityFile ~/.ssh/id_rsa# IdentityFile ~/.ssh/id_dsa
把前面#去掉,然后在 IdentityFile 后填写你用来执行ssh时所用的密钥
0 0
- 使用ssh-keygen生成私钥和公钥
- 使用ssh-keygen生成私钥和公钥
- 使用ssh-keygen生成公私钥
- Git生成公钥 bash:ssh-keygen command not found
- 如何使用ssh-keygen生成key
- ssh-keygen 产生公钥与私钥对.
- ssh-keygen生成公私钥免密码登录远程服务器
- Linux系统用ssh-keygen生成公私钥
- SSH-KEYGEN使用
- [Linux] 在 Linux CLI 使用 ssh-keygen 生成 RSA 密钥
- [Linux] 在 Linux CLI 使用 ssh-keygen 生成 RSA 密钥
- [Linux] 在 Linux CLI 使用 ssh-keygen 生成 RSA 密钥
- [Linux] 在 Linux CLI 使用 ssh-keygen 生成 RSA 密钥
- [Linux] 在 Linux CLI 使用 ssh-keygen 生成 RSA 密钥
- linux下使用ssh-keygen生成公钥私钥对
- ssh-keygen - 生成、管理和转换认证密钥
- 【ssh-keygen】生成、管理和转换认证密钥
- ssh-keygen秘钥登陆(免密码)
- Button鼠标箭头变手势
- SVN版本控制工具的权限设置
- android获取目录文件values/arrays.xml数据的方法,简易快捷
- BootStrap进度条
- hdu 5360 Hiking
- 使用ssh-keygen生成私钥和公钥
- 用Cygwin在Windows上架设NFS Server
- UIView的transform属性
- HWOJ题目
- Unity Manual之CharacterController 角色控制器
- Eclipse环境下配置spket,开发ExtJS提示插件
- oracle查看表空间使用大小和扩展表空间
- 事务
- UIVIEW 的旋转与缩放以及同时应用两种效果(一)