歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Ubuntu Linux >> ubuntu16.04服務器配置ssh免密登錄,ubuntu16.04ssh

ubuntu16.04服務器配置ssh免密登錄,ubuntu16.04ssh

日期:2017/3/3 18:09:32   编辑:Ubuntu Linux

ubuntu16.04服務器配置ssh免密登錄,ubuntu16.04ssh

ubuntu16.04服務器配置ssh免密登錄,ubuntu16.04ssh


原版資料英文,鏈接在此 https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
在客戶端操作 ssh-keygen -t rsa 文件位置寫/home/try/.ssh/server_rsa,不使用默認值,我命名為server_rsa擔心影響到git的key(因為我的git使用的是默認值) ssh-copy-id [email protected](你的服務器ip), 或這使用 cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" 即可將,你的客戶端key傳到服務器的~/.ssh/authorized_keys文件中,也可手動復制進去。 在服務器端操作 sudo nano /etc/ssh/sshd_config 更改這條為without-password,實現root免密登錄 即 PermitRootLogin without-password
ssh簡寫技巧 vim ~/.ssh/config 添加 Host lisa 隨便起的,好記就行 HostName 188.166.225.189 你的服務器ip User root Port 9999(端口自定,推薦不加) (後兩條我未曾用到,前三條足以) IdentityFile ~/.ssh/id_rsa 認證的key位置,如果已經傳到服務器就不用這條了 可實現使用 ssh lisa 來代替 ssh [email protected]的效果

http://xxxxxx/Linuxjc/1169356.html TechArticle

Copyright © Linux教程網 All Rights Reserved