18禁网站免费,成年人黄色视频网站,熟妇高潮一区二区在线播放,国产精品高潮呻吟AV

學習啦>學習電腦>操作系統(tǒng)>Linux教程>

liunx ssh免密碼登錄命令行

時間: 志藝942 分享

  SSH最初是UNIX系統(tǒng)上的一個程序,后來又迅速擴展到其他操作平臺。那么你知道liunx ssh免密碼登錄命令行么?接下來是小編為大家收集的liunx ssh免密碼登錄命令行,歡迎大家閱讀:

  liunx ssh免密碼登錄命令行

  1、使用 ssh-keygen -t rsa 生成私鑰和公鑰

  ssh-keygen -b 1024 -t dsa

  Generating public/private dsa key pair.

  Enter file in which to save the key (/home/user/.ssh/id_dsa): /home/user/.ssh/id_dsa

  Enter passphrase (empty for no passphrase):

  Enter same passphrase again:

  Your identification has been saved in /home/user/.ssh/id_rsa.

  Your public key has been saved in /home/user/.ssh/id_ras.pub.

  www.2cto.com

  2、密鑰分發(fā)

  把私鑰放在自己的機器上的~/.ssh/目錄下并保證訪問權限是“-rw-------”(即600)。

  再把生成的公鑰放在要連接的遠程主機的~/.ssh/目錄下并改名為authorized_keys,并且保證文件除了屬主外沒有被人修改的權限。

  命令

  cd ~/.ssh

  ssh-copy-id user@IP

  or

  ssh-copy-id –i id_rsa.pub user@IP

  3、登錄

  ssh username@ip直接登錄

  4、運行命令

  ssh user@ip ./test.sh

  普通用戶ssh連接linux服務器是總是提示:

  ulimit: open files: cannot modify limit: Operation not permitted

  解決辦法:

  vi /etc/security/limits.conf

  添加: www.2cto.com

  * soft nofile 65535

  * hard nofile 65535

  如果無法登錄,

  刪除/home/user/.ssh/known_hosts文件再試

  
看了“liunx ssh免密碼登錄命令行”還想看:

1.linux命令ssh遠程登錄命令簡單實例

2.教你Linux的遠程登錄方法和無密碼登錄方法

3.ssh遠程執(zhí)行命令方法和Shell腳本實例

4.linux ssh 別名登錄教程

2961577