博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Working with SSH keys
阅读量:5172 次
发布时间:2019-06-13

本文共 1489 字,大约阅读时间需要 4 分钟。

SSH keys are a way to identify trusted computers, without involving passwords. Most git servers choose SSH keys to authorize clients.

Check for SSH keys

check for existing SSH keys on your computer.

$ ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
Check the directory listing to see if you already have a public SSH key. By default, the filenames of the public keys are one of the following:
  • id_rsa.pub
  • id_dsa.pub

Generate a new SSH key

1) Creates a new ssh key, using the provided email as a label
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
2) We strongly suggest keeping the default settings as they are, so when you're prompted to "Enter a file in which to save the key", just press Enter to continue.
Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
3) We strongly recommend a very good, secure passphrase.
Enter passphrase (empty for no passphrase): [Type a passphrase]Enter same passphrase again: [Type passphrase again]
4) After you enter a passphrase, review the fingerprint, or id, of your SSH key.

Add the New SSH Key to Server

Add the content of id_dsa.pub to the end of  sever’s authorized_keys

echo ‘the content of id_dsa.pub’ >> ~/.ssh/authorized_keys

Configure SSH Client

Edit ssh configuration file ‘~/.ssh/config’.

Host servernameHostName 192.168.3.1User AdminIdentityFile ~/.ssh/id_rsaCompressionLevel 6

Now you can test the ssh connection

ssh servername

转载于:https://www.cnblogs.com/luckysimple/p/5105089.html

你可能感兴趣的文章
IBM RSA 的语言设置
查看>>
《http权威指南》阅读笔记(二)
查看>>
faster r-cnn cudnn版本不兼容问题
查看>>
[置顶] ListBox控件的数据绑定
查看>>
链表插入排序
查看>>
http://blog.csdn.net/yunye114105/article/details/7997041
查看>>
设计模式这个东西 刚刚发现几种模式好像大同小异啊
查看>>
关于 主键和外键
查看>>
python集合的交,差,并,补集合运算汇总
查看>>
校园分期支付的机遇和风险
查看>>
怕忘记-windows 2003服务器安装Node.js NPM
查看>>
一鍵分享(優化后)
查看>>
dcm4che 的依赖无法下载
查看>>
cygwin主要命令
查看>>
多线程存在哪些风险
查看>>
洛谷P2692 覆盖 题解
查看>>
Linux下清理内存和Cache方法见下文:
查看>>
【AngularJs-模块篇-Form篇】
查看>>
支持向量基
查看>>
单链表 类
查看>>