×ðÁú¿­Ê±

ÔõÑùʹÓüÓÃܵÄÔ¶³ÌµÇ¼ЭÒ飨SSH£©± £»¤CentOSЧÀÍÆ÷

ÔõÑùʹÓüÓÃܵÄÔ¶³ÌµÇ¼ЭÒ飨ssh£©± £»¤centosЧÀÍÆ÷

СÐò£º

ÔÚµ±½ñµÄÊý×Öʱ´ú £¬Ð§ÀÍÆ÷µÄÇå¾²ÐÔºÜÊÇÒªº¦¡£ÎªÁ˱ £»¤Ð§ÀÍÆ÷ £¬ÎÒÃÇÐèÒª½ÓÄÉÖÖÖÖÇå¾²²½·¥ £¬ÆäÖÐÖ®Ò»¾ÍÊÇʹÓüÓÃܵÄÔ¶³ÌµÇ¼ЭÒé¡£SSH£¨Secure Shell£©ÊÇÒ»ÖÖ³£ÓõļÓÃÜÔ¶³ÌµÇ¼ЭÒé £¬Ëü¿ÉÒÔÓÐÓõر £»¤Ð§ÀÍÆ÷ÃâÊÜδ¾­ÊÚȨµÄ»á¼û¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃSSH± £»¤CentOSЧÀÍÆ÷ £¬²¢ÌṩÏìÓ¦µÄ´úÂëʾÀý¡£

°ì·¨Ò»£º×°ÖÃOpenSSHЧÀÍÆ÷

ÔÚCentOSЧÀÍÆ÷ÉÏʹÓÃSSH֮ǰ £¬ÎÒÃÇÊ×ÏÈÐèҪװÖÃOpenSSHЧÀÍÆ÷¡£ÒÔÏÂÊÇ×°ÖÃOpenSSHЧÀÍÆ÷µÄʾÀý´úÂ룺

sudo yum install openssh-server

µÇ¼ºó¸´ÖÆ

°ì·¨¶þ£ºÉèÖÃSSHЧÀÍÆ÷

Ò»µ©OpenSSHЧÀÍÆ÷×°ÖÃÍê³É £¬ÎÒÃÇÐèÒª¾ÙÐÐһЩÉèÖÃÒÔÈ·±£Ð§ÀÍÆ÷Çå¾²¡£Ö÷Òª°üÀ¨ÒÔϼ¸·½ÃæµÄÉèÖãº

½ûÓÃrootÓû§Ö±½ÓµÇ¼£ºÍ¨¹ý½ûÓÃrootÓû§Ö±½ÓµÇ¼ £¬¿ÉÒÔÓÐÓÃïÔ̭DZÔڵĹ¥»÷Σº¦¡£ÎÒÃÇ¿ÉÒÔͨ¹ý±à¼­SSHÉèÖÃÎļþ/etc/ssh/sshd_configʵÏÖ½ûÓÃrootÓû§µÇ¼µÄÄ¿µÄ£º

sudo vi /etc/ssh/sshd_config

µÇ¼ºó¸´ÖÆ

ÕÒµ½ÒÔÏÂÐв¢¾ÙÐÐÐ޸ģº

#PermitRootLogin yes

µÇ¼ºó¸´ÖÆ

ÐÞ¸ÄΪ£º

PermitRootLogin no

µÇ¼ºó¸´ÖÆ

ÉúÑIJ¢¹Ø±ÕÎļþ¡£

ʹÓù«Ô¿ÈÏÖ¤µÇ¼£ºÊ¹Óù«Ô¿ÈÏÖ¤µÇ¼¿ÉÒÔ´ó´óÔöÌíЧÀÍÆ÷µÄÇå¾²ÐÔ¡£ÒÔÏÂÊÇÔõÑùÉèÖù«Ô¿ÈÏÖ¤µÇ¼µÄ°ì·¨£º

Ê×ÏÈ £¬ÎÒÃÇÐèÒªÌìÉúÒ»¶Ô¹«Ô¿ºÍ˽Կ¡£±¾Ê¾ÀýÖÐ £¬ÎÒÃǽ«ÌìÉúÒ»¶ÔеÄRSAÃÜÔ¿£º

ssh-keygen -t rsa -b 4096

µÇ¼ºó¸´ÖÆ

È»ºó £¬½«¹«Ô¿Ìí¼Óµ½Ð§ÀÍÆ÷µÄ~/.ssh/authorized_keysÎļþÖÐ £¬ÒÔʵÏÖ¹«Ô¿ÈÏÖ¤£º

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

µÇ¼ºó¸´ÖÆ

×îºó £¬ÐÞ¸ÄÎļþȨÏÞÒÔÈ·±£ÎÞ·¨´ÓÍⲿ¶Áȡ˽Կ£º

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

µÇ¼ºó¸´ÖÆ

ÉúÑIJ¢Í˳ö¡£

°ì·¨Èý£ºÖØÆôSSHЧÀÍ

ÔÚÍê³ÉÉèÖúó £¬ÎÒÃÇÐèÒªÖØÆôSSHЧÀÍÒÔʹ¸ü¸ÄÉúЧ£º

sudo systemctl restart sshd

µÇ¼ºó¸´ÖÆ

°ì·¨ËÄ£º²âÊÔSSHÅþÁ¬

ÏÖÔÚ £¬ÎÒÃÇ¿ÉÒÔʹÓÃSSH¿Í»§¶ËÅþÁ¬µ½CentOSЧÀÍÆ÷²¢¾ÙÐвâÊÔ¡£ÒÔÏÂÊÇÔõÑùʹÓÃSSHÅþÁ¬µÄʾÀý´úÂ룺

ssh [Óû§Ãû]@[ЧÀÍÆ÷IPµØµã]

µÇ¼ºó¸´ÖÆ

ʾÀý£º

ssh john@192.168.0.100

µÇ¼ºó¸´ÖÆ

ÈôÊÇÒ»ÇÐÕý³£ £¬Ä㽫»á±»ÌáÐÑÊäÈëÃÜÂë £¬È»ºóÀֳɵǼµ½Ð§ÀÍÆ÷¡£

½áÂÛ£º

ʹÓüÓÃܵÄÔ¶³ÌµÇ¼ЭÒ飨SSH£©ÊDZ £»¤CentOSЧÀÍÆ÷µÄÖ÷Òª°ì·¨Ö®Ò»¡£Í¨¹ý½ûÓÃrootÓû§Ö±½ÓµÇ¼ºÍʹÓù«Ô¿ÈÏÖ¤µÇ¼ £¬ÎÒÃÇ¿ÉÒÔÓÐÓõØÌá¸ßЧÀÍÆ÷µÄÇå¾²ÐÔ¡£±¾ÎÄÌṩÁË×°ÖúÍÉèÖÃOpenSSHЧÀÍÆ÷µÄ°ì·¨ºÍʾÀý´úÂë £¬Ï£Íû¶ÔÄú± £»¤Ð§ÀÍÆ÷ÓÐËù×ÊÖú¡£¼Ç×Å £¬Ð§ÀÍÆ÷Çå¾²ÊÇÒ»¸öÒ»Á¬µÄÀú³Ì £¬ÎÒÃÇÓ¦¸ÃÇ×½ü¹Ø×¢×îеÄÇå¾²±ê×¼ºÍ×î¼Ñʵ¼ù £¬ÊµÊ±¸üкÍÔöǿЧÀÍÆ÷µÄÇå¾²ÐÔ¡£

ÒÔÉϾÍÊÇÔõÑùʹÓüÓÃܵÄÔ¶³ÌµÇ¼ЭÒ飨SSH£©± £»¤CentOSЧÀÍÆ÷µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±ÊµÊ±ÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
¡¾ÍøÕ¾µØͼ¡¿¡¾sitemap¡¿