sshã§æ¥ç¶æã®ãToo many authentication failures for usernameãã¨ã©ã¼ã®å¯¾å¦æ³
ãssh-agentããåä½ãã¦ããå ´å ã®å 容ãè¨æ£ãã¾ãã
åå ã¯æ¥ç¶å
ãµã¼ãã®sshd_configã§è¨å®ããã¦ãsshã®æ大試è¡å¯è½åæ°ãè¶ããã£ã¦äºã
ä½ã§ãããªã¨ã©ã¼ãçºçãããã£ã¦ã®ã¯ã
æ¥ç¶å
ã®sshã¯ã©ã¤ã¢ã³ããssh_configã®PreferredAuthenticationsã«ã¦è¨å®ããã¦ãé ã§æ¥ç¶ã試ãã¦ããã失æããããããã
対å¿æ¹æ³ã¯ãä»åæ¥ç¶ãããã¨ãã¦ãããµã¼ãã®èªè¨¼æ¹æ³ã«ãã£ã¦ã¡ãã£ã¨éã£ã¦ããã
passwordèªè¨¼ã®ãµã¼ãã«æ¥ç¶ãããå ´å
ä¸è¿°ããã¯ã©ã¤ã¢ã³ãã®ssh_configã«ä»¥ä¸ã®è¨å®ã追å ãã¦ããã°ããã
PreferredAuthentications password
ã¾ãã¯ãæ¥ç¶ã³ãã³ãã«ç´æ¥ãªãã·ã§ã³æå®ãã¦ãã£ã¦ãokã
ssh username@IPAddress -o PreferredAuthentications=password
publickeyèªè¨¼ã®ãµã¼ãã«æ¥ç¶ãããå ´å
ãã®å ´åã¯ã¯ã©ã¤ã¢ã³ãã§ãssh-agentããåä½ãã¦ããã©ããã§å¯¾å¿æ¹æ³ãå¤ããã
ãssh-agentããåä½ãã¦ããªãå ´å
ä¸è¿°ããã¯ã©ã¤ã¢ã³ãã®ssh_configã«ä»¥ä¸ã®è¨å®ã追å ãã¦ããã°ããã
IdentityFile /root/.ssh/id_rsa
ã¾ãã¯ãæ¥ç¶ã³ãã³ãã«ç´æ¥ãªãã·ã§ã³æå®ãã¦ãã£ã¦ãokã
ssh username@IPAddress -o IdentityFile /root/.ssh/id_rsa
ãssh-agentããåä½ãã¦ããå ´å
ssh-agentã¯ssh-addã«ã¦ç»é²ããã¦ããéµãã¡ã¤ã«ãé ã«è©¦ãã¦ãããä»»æã«ãã®é çªãæå®ããäºã¯åºæ¥ãªãã®ã§ãæ ¹æ¬çã«éµãã¡ã¤ã«ãç»é²ãéãã¦ããã®ãåé¡ã
å¿
è¦ã®ç¡ãéµãã¡ã¤ã«ãåé¤ãããããµã¼ãå¨ãã®ç°å¢ãè¦ç´ããæ¹ãããã®ããã
IdentitiesOnlyãæå®ãã¦ããã°okã§ããã
Host hogehoge.com HostName fugafuga.com User hogo Port 12345 IdentitiesOnly yes IdentityFile ~/.ssh/id_rsa
ã¨ãããããæ¸ãã¦ã¯ã¿ããã©ãããªèªä¿¡ã¯ãªãã
ãããsshã®èªè¨¼æ¹å¼ã¯ãã¡ããä»ã«ããããã©ããã¯ãã¼ã¿ããã§ã