尊龙凯时人生就是搏

± £»¤ÄãµÄLinuxЧÀÍÆ÷£ºÓÃÏÂÁîÐоÙÐÐÉí·ÝÑéÖ¤

± £»¤ÄãµÄLinuxЧÀÍÆ÷£ºÓÃÏÂÁîÐоÙÐÐÉí·ÝÑéÖ¤

ÔÚµ±½ñÊý×Ö»¯Ê±´ú £¬± £»¤Ð§ÀÍÆ÷µÄÇå¾²ÒѾ­±äµÃÓÈΪÖ÷Òª¡£×÷Ϊһ¸öLinuxЧÀÍÆ÷ÖÎÀíÔ± £¬ÄãÐèÒª½ÓÄÉһϵÁеÄÇå¾²²½·¥À´È·±£Ð§ÀÍÆ÷²»Êܵ½¶ñÒâÈëÇÖºÍδ¾­ÊÚȨµÄ»á¼û¡£ÆäÖÐÒ»¸öÒªº¦µÄÇå¾²²½·¥ÊÇʹÓÃÇ¿Ê¢µÄÉí·ÝÑéÖ¤ÒªÁì¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃÏÂÁîÐоÙÐÐÉí·ÝÑéÖ¤ £¬ÒÔÔöÇ¿ÄãµÄLinuxЧÀÍÆ÷µÄÇå¾²ÐÔ¡£

Ò»¡¢Ê¹ÓÃSSHÃÜÔ¿¶Ô¾ÙÐÐÉí·ÝÑéÖ¤

SSH£¨Secure Shell£©ÊÇÒ»¸ö³£ÓõÄÔ¶³ÌµÇ¼ЭÒé £¬½ÓÄÉÁ˼ÓÃܵķ½·¨¾ÙÐÐͨѶ¡£Ê¹ÓÃSSHÃÜÔ¿¶Ô¾ÙÐÐÉí·ÝÑéÖ¤±È¹Å°åµÄÓû§ÃûºÍÃÜÂëÈÏÖ¤Ô½·¢Çå¾²¿É¿¿¡£ÏÂÃæÊÇÉèÖÃSSHÃÜÔ¿¶ÔµÄ°ì·¨£º

ÌìÉúSSHÃÜÔ¿¶Ô£º·­¿ªÖÕ¶Ë £¬²¢ÊäÈëÒÔÏÂÏÂÁ

$ ssh-keygen -t rsa -b 4096

ÉÏÊöÏÂÁÌìÉúÒ»¸ö4096λµÄRSAÃÜÔ¿¶Ô¡£

½«¹«Ô¿ÉÏ´«ÖÁЧÀÍÆ÷£ºÊ¹ÓÃÒÔÏÂÏÂÁ¹«Ô¿ÉÏ´«ÖÁЧÀÍÆ÷£º

$ ssh-copy-id username@servername

Ìæ»»usernameΪÄãµÄÓû§Ãû £¬servernameΪÄãµÄЧÀÍÆ÷µØµã¡£

²âÊÔSSHÅþÁ¬£ºÊ¹ÓÃÒÔÏÂÏÂÁî²âÊÔSSHÅþÁ¬ÊÇ·ñÀֳɣº

$ ssh username@servername

ÈôÊÇÅþÁ¬ÀÖ³É £¬½«ÎÞÐèÔÙÊäÈëÃÜÂë¡£

¶þ¡¢Ê¹ÓöàÒòËØÉí·ÝÑéÖ¤

¶àÒòËØÉí·ÝÑéÖ¤£¨MFA£©ÊÇÒ»ÖÖÔ½·¢Çå¾²µÄÉí·ÝÑéÖ¤ÒªÁì £¬ËüÒªÇóÓû§ÌṩÁ½¸ö»ò¶à¸ö×ÔÁ¦µÄÉí·ÝÑéÖ¤ÒªËØ¡£ÔÚLinuxЧÀÍÆ÷ÉÏ £¬Äã¿ÉÒÔʹÓÃGoogle AuthenticatorʵÏÖMFA¡£ÏÂÃæÊÇÉèÖÃGoogle AuthenticatorµÄ°ì·¨£º

×°ÖÃGoogle Authenticator£º·­¿ªÖÕ¶Ë £¬²¢ÊäÈëÒÔÏÂÏÂÁî×°ÖÃGoogle Authenticator£º

$ sudo apt-get install libpam-google-authenticator

Õ⽫װÖÃGoogle Authenticator¿â¡£

ÉèÖÃGoogle Authenticator£ºÊäÈëÒÔÏÂÏÂÁîÉèÖÃGoogle Authenticator£º

$ google-authenticator

ÔÚÉèÖÃÀú³ÌÖÐ £¬Ä㽫±»ÒªÇó»Ø¸²Ò»Ð©ÎÊÌâ £¬²¢ÌìÉúÒ»¸ö¶þάÂë¡£

ÉèÖÃPAMÄ£¿é£ºÊ¹ÓÃÎı¾±à¼­Æ÷·­¿ª/etc/pam.d/sshdÎļþ £¬²¢Ìí¼ÓÒÔÏÂÄÚÈÝ£º

auth required pam_google_authenticator.so

È·±£¸ÃÐÐÔÚChallengeResponseAuthentication֮ǰ¡£

ÖØÐÂÆô¶¯SSHЧÀÍ£ºÊäÈëÒÔÏÂÏÂÁîÒÔÖØÐÂÆô¶¯SSHЧÀÍ£º

$ sudo service ssh restart

Õ⽫ʹGoogle AuthenticatorÉúЧ¡£

²âÊÔMFA£ºÊ¹ÓÃÖն˵ǼLinuxЧÀÍÆ÷ʱ £¬³ýÁËÊäÈëÓû§ÃûºÍÃÜÂëÍâ £¬»¹½«ÒªÇóÊäÈëGoogle AuthenticatorÌìÉúµÄÑéÖ¤Âë¡£

Èý¡¢½ûÓÃrootÓû§Éí·ÝÑéÖ¤

rootÓû§ÊÇLinuxЧÀÍÆ÷ÉϾßÓÐÍêȫȨÏ޵ij¬µÈÓû§¡£ÎªÁËÌá¸ßЧÀÍÆ÷µÄÇå¾²ÐÔ £¬ÎÒÃÇͨ³£½¨Òé½ûÓÃrootÓû§Ö±½ÓµÇ¼¡£È¡¶ø´úÖ®µÄÊÇ £¬Äã¿ÉÒÔ½¨ÉèÒ»¸öͨË×Óû§ £¬²¢ÎªÆ丶ÓësudoȨÏÞ¡£ÏÂÃæÊǽûÓÃrootÓû§µÄ°ì·¨£º

½¨ÉèÒ»¸öÐÂÓû§£ºÊ¹ÓÃÒÔÏÂÏÂÁÉèÒ»¸öÐÂÓû§£º

$ sudo adduser username

½«usernameÌ滻ΪÄãÏ뽨ÉèµÄÓû§Ãû¡£

ΪÐÂÓû§¸¶ÓësudoȨÏÞ£ºÊäÈëÒÔÏÂÏÂÁîΪÐÂÓû§¸¶ÓësudoȨÏÞ£º

$ sudo usermod -aG sudo username

½«usernameÌ滻ΪÄ㽨ÉèµÄÓû§Ãû¡£

½ûÓÃrootÓû§µÇ¼£ºÊ¹ÓÃÒÔÏÂÏÂÁî±à¼­/etc/ssh/sshd_configÎļþ£º

$ sudo nano /etc/ssh/sshd_config

ÔÚÎļþÖÐÕÒµ½ÒÔÏÂÐУº

PermitRootLogin yes

½«¸ÃÐÐÐÞ¸ÄΪ£º

PermitRootLogin no

ÉúÑÄÎļþ²¢ÖØÐÂÆô¶¯SSHЧÀÍ£º

$ sudo service ssh restart

ÏÖÔÚ £¬ÄãµÄLinuxЧÀÍÆ÷½«²»ÔÊÐírootÓû§Ö±½ÓµÇ¼¡£

ͨ¹ýÒÔÉÏÈý¸ö°ì·¨ £¬Äã¿ÉÒÔÓÃÏÂÁîÐÐʵÏÖÔ½·¢Çå¾²µÄÉí·ÝÑéÖ¤À´ÔöÇ¿ÄãµÄLinuxЧÀÍÆ÷µÄÇå¾²ÐÔ¡£SSHÃÜÔ¿¶Ô¡¢¶àÒòËØÉí·ÝÑéÖ¤ºÍ½ûÓÃrootÓû§µÇ¼¿ÉÒÔ´ó´óïÔÌ­¶ñÒâÈëÇÖºÍδ¾­ÊÚȨ»á¼ûµÄΣº¦¡£Òò´Ë £¬ÔÚÖÎÀíºÍ± £»¤ÄãµÄLinuxЧÀÍÆ÷ʱ £¬È·±£Ê¹ÓÃÕâЩÇå¾²²½·¥ÊÇÖÁ¹ØÖ÷ÒªµÄ¡£± £»¤ÄãµÄЧÀÍÆ÷ £¬± £»¤ÄãµÄÊý¾ÝÇå¾²¡£

ÒÔÉϾÍÊDZ £»¤ÄãµÄLinuxЧÀÍÆ÷£ºÓÃÏÂÁîÐоÙÐÐÉí·ÝÑéÖ¤µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

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

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

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