ssh-copy-id
ãssh-copy-idã³ãã³ããä»ããç¥ã£ãã®ã§ãã¡ã¢ã
ãä½ã«ä½¿ãã³ãã³ããã¨ããã¨ãsshã®ã¯ã©ã¤ã¢ã³ãèªè¨¼ã§ä½¿ãå
¬ééµããµã¼ãã¼å´ã«ã³ãã¼ããã®ã«ä½¿ãã
ãsshã§ãªã¢ã¼ããã¹ãã«æ¥ç¶ããå ´åãæ¥ç¶å ã®ãªã¢ã¼ããã¹ãã«å ¬ééµãç»é²ããå¿ è¦ãããããssh-copy-idã³ãã³ãã使ããªãã¨æ¬¡ã®æé ã«ãªãã
ãssh-keygen -t dsa
âå ¬ééµã¨ç§å¯éµãä½æ
ãscp .ssh/id_rsa.pub 192.168.1.16:~
âå ¬ééµããªã¢ã¼ããã¹ãã®ã¦ã¼ã¶ã¼ã®ãã¼ã ãã£ã¬ã¯ããªã«ã³ãã¼
ãssh 192.168.1.16
âãªã¢ã¼ããã¹ãã«æ¥ç¶ãããã§ãã¹ã¯ã¼ããå ¥å
ãmkdir .ssh
âã¦ã¼ã¶ã¼ã®ãã¼ã ãã£ã¬ã¯ããªã«.sshãã£ã¬ã¯ããªããªããã°ä½æ
ãcat id_dsa.pub >> .ssh/authorized_keys
âå ¬ééµãauthorized_keysãã¡ã¤ã«ã«ç»é²
ããããssh-copy-idã³ãã³ãã使ãã¨ã以ä¸ã®æé ã§ããã
ãssh-keygen -t dsa
ãssh-copy-id -i .ssh/id_dsa.pub [email protected]
ã
ãéµãä½æãã以éã®å¦çããã¼ããã·ã§ã³è¨å®ã¾ã§å«ãã¦ããã¡ãã¨ãã£ã¦ãããã®ã§ä¾¿å©ã
ããªããå
¬ééµã«ããã¯ã©ã¤ã¢ã³ãèªè¨¼ãæåããããsshd_configã®PasswordAuthenticationã¯ãNoãã«è¨å®ãã¾ãããã
ããã¹ã¯ã¼ãèªè¨¼ãç¡å¹ã«ããç»é²ããå
¬ééµã¨å¯¾å¿ããç§å¯éµããã¼ã«ã«ãã¹ãã«ç»é²ããã¦ããªãã¨ãæ¥ç¶ã§ããªãã¨ããããã«ããã¨ãsshã«ãããªã¢ã¼ãæ¥ç¶ãå®å
¨ã«éå¶ã§ããã