【原创】大叔经验分享(85)ssh秘钥之创建和使用
一 创建秘钥
1 Macbook
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key ($HOME/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in $HOME/.ssh/id_rsa.
Your public key has been saved in $HOME/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:HqDbdb3SyrM2pPj+rrZt0F34GUjVIlDpEKuTOT473KU you@HOST
The key's randomart image is:
+---[RSA 2048]----+
| o+.o.. |
| ..+ . .|
| . .+ + . |
| . . + .+ o |
| . S....o o |
| o +.=o.o.o |
| . .o+=.oo |
| . ==Eo |
| +*OB+ |
+----[SHA256]-----+
$ ls -l .ssh
total 24
-rw------- 1 you staff 1876 Sep 11 23:07 id_rsa
-rw-r--r-- 1 you staff 404 Sep 11 23:07 id_rsa.pub
-rw-r--r-- 1 you staff 1046 Aug 3 10:06 known_hosts
2 Windows
2.1 XShell




2.2 SecureCRT





二 使用秘钥登录
1 Macbook
秘钥默认文件名及路径
$ vi /etc/ssh/ssh_config
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
如果秘钥在以上路径,直接登录即可
$ ssh you@1.1.1.1
如果秘钥不在以上路径,有两种方法:
1)通过-i指定秘钥路径
$ ssh -i /path/to/id_rsa you@1.1.1.1
2)修改/etc/ssh/ssh_config
2 Windows
2.1 XShell

2.2 SecureCRT

【原创】大叔经验分享(85)ssh秘钥之创建和使用的更多相关文章
- 【原创】Linux基础之SSH秘钥登录
官方:https://www.ssh.com/ssh/ The SSH protocol uses encryption to secure the connection between a clie ...
- github使用ssh秘钥的好处以及设置(转)
git使用https协议,每次pull,push都要输入密码,使用git协议,使用ssh秘钥,可以省去每次输密码 大概需要三个步骤:一.本地生成密钥对:二.设置github上的公钥:三.修改git的r ...
- ssh秘钥交换详解与实现 diffie-hellman-group-exchange-sha
ssh的DH秘钥交换是一套复合几种算法的秘钥交换算法.在RFC4419中称为diffie-hellman-groupX-exchange-shaX 的算法(也有另一种单纯的 rsaX-shaX 交换算 ...
- 通过ssh秘钥的方式可以连接上CE68交换机
结论:按照CE68交换机的用户手册中的指导,可以通过ssh 秘钥的方式连接上交换机. 1.先按照eNSP连接到网卡的方式,给CE68配置一个ip地址: 192.168.56.2 2.按照交换机的用户指 ...
- TortoiseGit与GIt生成ssh秘钥添加到github账号的简单方法!简单使用
今天升级了自己电脑上的git与TortoiseGit,全部换成了最新版,后来不知道怎么的git的秘钥还能使用,可以直接拉取或者提交ssh地址克隆的代码,可是小乌龟客户端就悲剧了 公司的项目有key.p ...
- github 生成配置ssh 秘钥方法详解
如果安装github成功后,当从本地提交文件到github的时候,提交不成功,报错,可能问题就是你还没有生成ssh秘钥 1.当你提交文件到github,不成功,出现如下的情况,就代表着github上面 ...
- 在windows上使用ssh秘钥连接git服务器
git部署在centos7上 安装好git后,新建一个用户test(注意要加入git用户组)配置ssh秘钥登录,我的另一篇博客有写配置步骤 重点的地方是在windows系统上使用秘钥登录git服务器 ...
- 【github】添加 ssh 秘钥
1 生成秘钥 打开shell 备注: 123@example.com 为邮箱地址 ssh-keygen -t rsa -C "123@example.com" 此处选Y ,其他都是 ...
- linux查看及设置别名,权限,生成ssh秘钥
1.alias :查看系统中所有的命令别名 2.设定别名 alias 别名='原命令' 3.删除别名 unalias 别名 4.使别名永久生效 vi ~/.bashrc 写入这个文件中即可永 ...
随机推荐
- MeasureSpec常用方法
package com.loaderman.customviewdemo; import android.content.Context; import android.util.AttributeS ...
- osg 三维模型加载与解析(fbx、3ds、ive、obj、osg)
void TeslaManage::OnlineTreeViewDoubleClick(const QModelIndex & index) { int row = index.row(); ...
- 阶段5 3.微服务项目【学成在线】_day17 用户认证 Zuul_16-网关-过虑器
4.5 过虑器 Zuul的核心就是过虑器,通过过虑器实现请求过虑,身份校验等. 4.5.1 ZuulFilter 自定义过虑器需要继承 ZuulFilter,ZuulFilter是一个抽象类,需要覆盖 ...
- PAT 甲级 1038 Recover the Smallest Number (30 分)(思维题,贪心)
1038 Recover the Smallest Number (30 分) Given a collection of number segments, you are supposed to ...
- Python的Asyncore异步Socket模块及实现端口转发的例子
Python的Asyncore异步Socket模块及实现端口转发的例子 Asyncore模块提供了以异步的方式写入套接字服务客户端和服务器的基础结构. 只有两种方式使一个程序在单处理器上实现" ...
- SQl 2008 如何清除登陆过的服务器名称
C:\Users\Administrator\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin ...
- linux系统时间设定
更改系统时间并同步硬件时钟 sudo date -s '2018-12-27 12:46' sudo hwclock --systohc hwclock说明:hwclock --help
- 一个websocket的demo(php server)
notice: 通过命令行执行php文件 如 php -q c:\path\server.php 通过本地web服务器访问 http://127.0.0.1/websocket/index.php即 ...
- CommMonitor8.0 串口过滤驱动 SDK DLL版本 C#/Delphi调用DEMO
CommMonitor8.0 SDK DLL 版本,此版本是直接调用DLL. Delphi调用定义: constCommMOnitor8x = ‘CommMOnitor8x.dll’; typeTOn ...
- 斑马打印机ZBL语言
ZBL手册:https://pan.baidu.com/s/1I8DaMUlf-9ytUwqtURw8rw 下面是打印CODE128条形码的代码 ^XA^FO100,100^BY6 ...