ssh¤Ã¤Æ †¥µ¡¼¥Ð¤Ø¤Î¥ê¥â¡¼¥È¥í¥°¥¤¥ó¤Ï¡¢¥Ç¡¼¥¿¤¬Ê¿Ê¸¤Çή¤ì¤ëTelnet¤è¤ê¤âssh¤ò»È¤¦¤Î¤¬¤è¤¤¤Ç¤¹¡£¤Þ¤¿ssh¤Ï¥Ñ¥¹¥ï¡¼¥É¤Ë¤è¤ë¥í¥°¥¤¥óǧ¾Ú¤À¤±¤Ç¤Ê¤¯¡¢¸ø³«¸°°Å¹æÊý¼°¤òÍѤ¤¤¿¥í¥°¥¤¥óǧ¾Ú¤â¤Ç¤¤Æ¡¢¤è¤ê¥»¥¥å¥¢¤Ç¤¹¡£ ¤ä¤Ã¤Æ¤ß¤ë †¼ÂºÝ¤ËFedora7¤Ç¡¢¸ø³«¸°°Å¹æÊý¼°¤Îssh¥í¥°¥¤¥ó´Ä¶¤òºî¤Ã¤Æ¤ß¤Þ¤¹¡£ [hoge@www ~]$ ssh-keygen -t rsa <- RSA°Å¹æÊý¼°¤Î¥¡¼¥Ú¥¢ºîÀ® Generating public/private rsa key pair. Enter file in which to save the key (/home/hoge/.ssh/id_rsa): Enter passphrase (empty for no passphrase): <-¥Ñ¥¹¥ï¡¼¥É(¥Ñ¥¹¥Õ¥ì¡¼¥º)¤òÆþÎÏ Enter same passphrase again: Your identification has been saved in /home/hoge/.ssh/id_rsa. Your public key has been saved in /home/hoge/.ssh/id_rsa.pub. The key fingerprint is: xx:xx:xx:xx;............................... hoge@www.fuga.com ¥¡¼¥Ú¥¢¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿¡£¸ø³«¸°¤ÎÊý(id_rsa.pub)¤Ï¥ê¥Í¡¼¥à¤·¤Æ¥µ¡¼¥Ð¤Ë¤ª¤¤¤Æ¤ª¤¤Þ¤¹¡£ÈëÌ©¸°¤ÎÊý¤Ï°ÂÁ´¤ÊÊýË¡¤Ç¥¯¥é¥¤¥¢¥ó¥È¤Ë»ý¤Ã¤Æ¤¯¤ë¤³¤È¤Ë¤·¤Þ¤¹*1¡£ [hoge@www ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢¬authorized_keys¤È¤¤¤¦Ì¾Á°¤Ë¥ê¥Í¡¼¥à [hoge@www ~]$ cd ~/.ssh/ [hoge@www .ssh]$ ls -lrt ¹ç·× 16 -rw-r--r-- 1 hoge hoge 406 2008-04-04 00:37 id_rsa.pub -rw------- 1 hoge hoge 1743 2008-04-04 00:37 id_rsa <-ÈëÌ©¸° -rw-rw-r-- 1 hoge hoge 406 2008-04-04 00:49 authorized_keys <-¸ø³«¸° [hoge@www .ssh]$ chmod 600 authorized_keys [hoge@www .ssh]$ rm id_rsa.pub [hoge@www .ssh]$ ls -lrt -rw------- 1 hoge hoge 1743 2008-04-04 00:37 id_rsa -rw------- 1 hoge hoge 406 2008-04-04 00:49 authorized_keys [hoge@www .ssh]$ ¥¯¥é¥¤¥¢¥ó¥È¤ËÈëÌ©¸°(id_rsa)¤ò°ÂÁ´¤ËžÁ÷¤·¤¿¤é¡¢¥µ¡¼¥Ð¾å¤Îid_rsa¤Ïºï½ü¤·¤Æ¤ª¤¤Þ¤¹¡£ ¤Ç¤Ï¼ÂºÝ¤ËTeraterm¤Ê¤É¤Ç¤Ä¤Ê¤¤¤Ç¤ß¤Þ¤¹¡£Ä̾ï¤ÏTeraterm¤ÇID/PASS¤òÆþÎϤ·¤Æ¤¤¤Þ¤·¤¿¤¬¡¢ID¤ÈÀè¤Ë»ØÄꤷ¤¿¥Ñ¥¹¥Õ¥ì¡¼¥º¡¢ÈëÌ©¸°¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Æ¥í¥°¥¤¥ó¤¹¤ì¤Ð£Ï£Ë¤Ç¤¹¡£ RSA¤Ë¤è¤ë¥í¥°¥¤¥ó¤¬¼ºÇÔ¤¹¤ë¾ì¹ç¤Ï /etc/ssh/sshd_config ¤Ë RSAAuthentication yes ¤òÄɲ䷤ƤߤƤ¯¤À¤µ¤¤¡£¤Þ¤¿¡¢¤Ä¤¤¤Ç¤Ë¥Ñ¥¹¥ï¡¼¥É¤Ë¤è¤ë¥í¥°¥¤¥ó¤ò¤Ç¤¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï PasswordAuthentication no ¤È¤·¤Æ¤ª¤±¤Ð£Ï£Ë¤Ç¤¹¡£ TIPS½¸ †ssh¤Çroot¤ò¥í¥°¥¤¥ó¤Ç¤¤Ê¤¯¤¹¤ë †/etc/ssh/sshd_config ¤Ë PermitRootLogin no ¤òÄɲá£¤Ç /etc/init.d/sshd restart ¤Ç¥ê¥¹¥¿¡¼¥È¡£ ¥Ñ¥¹¥Õ¥ì¡¼¥º¤òÊѹ¹¤¹¤ë †[hoge@www ~]$ ssh-keygen -p -f id_rsa °ú¿ô¤Î-f°Ê¹ß¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢ ~/.ssh/id_rsa ¤È¤Ê¤ê¤Þ¤¹¡£ Mac¤Î¥¿¡¼¥ß¥Ê¥ë¤Ç¡¢id_rsa¤òÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë †ssh hogehoge@fugafuga.com -i ~/.ssh/id_rsafugafuga ¤Ê¤É¤È¤·¤ÆÈëÌ©¸°¤òÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ ¤³¤Îµ»ö¤Ï
¸½ºß¤Î¥¢¥¯¥»¥¹:3526 |