sudo gedit ~/.bashrc alias 179="ssh cis@10.10.243.179" alias s104="ssh cis@10.10.243.104" source ~/.bashrc ssh 生成公钥 ssh-keygen cd ~/.ssh upload id_rsa.pub to ssh server on the same directory cat ./id_ra.pub >> authorized_keys sudo chmod 644 ./authorized_keys then you can use 104,and 179 ssh to the server with NO type ip and remember password reference: Pro Gitprofessional version controlThis is an in-progress translation. To help translate the book, please fork the book at GitHub and push your contributions. 生成 SSH 公钥大多数 Git 服务器都会选择使用 SSH 公钥来进行授权。系统中的每个用户都必须提供一个公钥用于授权,没有的话就要生成一个。生成公钥的过程在所有操作系统上都差不多。首先先确认一下是否已经有一个公钥了。SSH 公钥默认储存在账户的主目录下的
关键是看有没有用
它先要求你确认保存公钥的位置( 现在,所有做过这一步的用户都得把它们的公钥给你或者 Git 服务器的管理员(假设 SSH 服务被设定为使用公钥机制)。他们只需要复制
关于在多个操作系统上设立相同 SSH 公钥的教程,可以查阅 GitHub 上有关 SSH 公钥的向导: Book translated into German, Chinese, Japanese and Dutch. Partial translations available in Arabic, Czech, Spanish, French, Indonesian, Italian, Macedonian, Polish, Thai and Russian . All content under Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. Theme and code by Michael Bleigh. Hosted by GitHub and powered by Jekyll.
| |
reference: