尊龙凯时人生就是搏

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

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

Ëæ×ÅÍøÂçµÄÉú³¤ £¬Ô¶³ÌµÇ¼ЧÀÍÆ÷³ÉΪÁËÖÎÀíЧÀÍÆ÷±Ø²»¿ÉÉٵķ½·¨¡£È»¶ø £¬¹Å°åµÄÔ¶³ÌµÇ¼ЭÒ飨Èçtelnet£©±£´æÇå¾²ÐÔÎÊÌâ £¬Òò´ËSSH£¨Secure Shell£©Ñ¸ËÙ³ÉΪÁËÊ×Ñ¡µÄÔ¶³ÌµÇ¼ЭÒé¡£ÔÚ±¾ÎÄÖÐ £¬ÎÒÃǽ«ÌÖÂÛÔõÑùʹÓÃSSH± £»¤CentOSЧÀÍÆ÷ £¬È·±£Êý¾ÝµÄÇå¾²ÐÔºÍÍêÕûÐÔ¡£

SSHÊÇÒ»ÖÖ¼ÓÃܵÄÍøÂçЭÒé £¬¿ÉÒÔÔÚ²»Çå¾²µÄÍøÂçÖÐÇå¾²µØ¾ÙÐÐÔ¶³ÌµÇ¼¡£ËüʹÓÃÁ˹«Ô¿¼ÓÃÜÊÖÒÕÀ´Ñé֤ЧÀÍÆ÷µÄÉí·Ý £¬²¢Í¨¹ý¹«Ô¿ºÍ˽ԿµÄ×éºÏ¾ÙÐÐÊý¾Ý¼ÓÃÜÏ¢ÕùÃÜ¡£

Ê×ÏÈ £¬ÎÒÃÇÐèҪȷ±£CentOSЧÀÍÆ÷ʹÓÃ×îа汾µÄSSH¡£Äú¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁî¼ì²éÄ¿½ñSSHµÄ°æ±¾£º

ssh -V

µÇ¼ºó¸´ÖÆ

ÈôÊÇÄúµÄϵͳÖÐûÓÐ×°ÖÃSSH £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî×°Öãº

yum install openssh-server

µÇ¼ºó¸´ÖÆ

ÔÚ×°ÖÃÍê³Éºó £¬ÎÒÃÇÐèÒª¶ÔSSH¾ÙÐÐһЩÉèÖÃÒÔÌá¸ßЧÀÍÆ÷µÄÇå¾²ÐÔ¡£

Ê×ÏÈ £¬ÎÒÃÇÐèÒª½ûÓÃSSHµÄrootµÇ¼¡£ÕâÊÇÓÉÓÚrootÓû§¾ßÓÐ×î¸ßȨÏÞ £¬ºÜÈÝÒ×Êܵ½¹¥»÷ÕߵĹ¥»÷¡£ÎÒÃÇ¿ÉÒÔͨ¹ý±à¼­SSHÉèÖÃÎļþÀ´½ûÓÃrootµÇ¼£º

vi /etc/ssh/sshd_config

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

ÕÒµ½ÒÔÏÂÐÐ £¬²¢½«ÆäÐÞ¸ÄΪno£º

PermitRootLogin no

µÇ¼ºó¸´ÖÆ

ÉúÑIJ¢¹Ø±ÕÎļþ¡£È»ºó £¬ÖØмÓÔØSSHЧÀÍÒÔʹ¸ü¸ÄÉúЧ£º

systemctl reload sshd

µÇ¼ºó¸´ÖÆ

½ÓÏÂÀ´ £¬ÎÒÃÇ¿ÉÒÔÉèÖøüÇ¿Ê¢µÄÃÜÂëÕ½ÂÔ¡£ÎÒÃÇ¿ÉÒÔͨ¹ý±à¼­PAM£¨Pluggable Authentication Modules£©ÉèÖÃÎļþÀ´ÊµÏÖ£º

vi /etc/pam.d/system-auth

µÇ¼ºó¸´ÖÆ

ÕÒµ½ÒÔÏÂÐÐ £¬²¢½«ÆäÐÞ¸ÄΪÒÔÏÂÄÚÈÝ£º

password    requisite     pam_pwquality.so try_first_pass retry=3 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8

µÇ¼ºó¸´ÖÆ

Õ⽫ÉèÖÃÃÜÂëÕ½ÂÔÒªÇóÃÜÂëÖÁÉÙ°üÀ¨8¸ö×Ö·û £¬²¢ÇÒ±ØÐèÒªÓÐÒ»¸öÊý×Ö¡¢Ò»¸ö´óд×Öĸ¡¢Ò»¸öСд×ÖĸºÍÒ»¸öÌØÊâ×Ö·û¡£

È»ºó £¬ÎÒÃÇ¿ÉÒÔÉèÖÃSSHµÄÇ徲ѡÏî¡£ÎÒÃÇ¿ÉÒÔͨ¹ý±à¼­SSHÉèÖÃÎļþÀ´ÊµÏÖ£º

vi /etc/ssh/sshd_config

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

ÕÒµ½ÒÔÏÂÐÐ £¬²¢½«ÆäÐÞ¸ÄΪÒÔÏÂÄÚÈÝ£º

PermitEmptyPasswords no
MaxAuthTries 3
AllowUsers username

µÇ¼ºó¸´ÖÆ

Õ⽫եȡ¿ÕÃÜÂëµÇ¼ £¬ÏÞÖÆÉí·ÝÑé֤ʵÑéµÄ´ÎÊýΪ3´Î £¬²¢ÇÒ½öÔÊÐíÖ¸¶¨µÄÓû§µÇ¼¡£

×îºó £¬ÎÒÃÇ»¹¿ÉÒÔͨ¹ýʹÓù«Ô¿ÈÏÖ¤À´Ìá¸ßSSHµÄÇå¾²ÐÔ¡£Ê×ÏÈ £¬ÔÚ¿Í»§¶ËÉÏÌìÉú¹«Ô¿ºÍ˽Կ¡£Äú¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´ÌìÉú£º

ssh-keygen

µÇ¼ºó¸´ÖÆ

È»ºó £¬½«¹«Ô¿Ìí¼Óµ½Ð§ÀÍÆ÷µÄauthorized_keysÎļþÖУº

ssh-copy-id username@server_ip

µÇ¼ºó¸´ÖÆ

ÊäÈëЧÀÍÆ÷ÃÜÂëºó £¬¹«Ô¿½«×Ô¶¯¸´ÖƵ½Ð§ÀÍÆ÷ÉÏ¡£ÕâÑù £¬Äú¾Í¿ÉÒÔʹÓÃ˽ԿÀ´¾ÙÐÐÉí·ÝÈÏÖ¤ £¬¶øÎÞÐèÊäÈëÃÜÂë¡£

ͨ¹ýÒÔÉÏ°ì·¨ £¬ÎÒÃÇÒѾ­ÀֳɵØÌá¸ßÁËCentOSЧÀÍÆ÷µÄÇå¾²ÐÔ¡£µ±Äú¾ÙÐÐÔ¶³ÌµÇ¼ʱ £¬Ê¹ÓÃSSHЭÒ齫ȷ±£Êý¾ÝµÄÇå¾²´«ÊäºÍЧÀÍÆ÷µÄÇå¾²ÐÔ¡£

×ܽá:

±¾ÎÄÏÈÈÝÁËÔõÑùʹÓÃSSH± £»¤CentOSЧÀÍÆ÷¡£Í¨¹ý½ûÓÃrootµÇ¼¡¢ÉèÖÃÃÜÂëÕ½ÂÔ¡¢ÉèÖÃÇ徲ѡÏîºÍʹÓù«Ô¿ÈÏÖ¤ £¬ÎÒÃÇ¿ÉÒÔÌá¸ßЧÀÍÆ÷µÄÇå¾²ÐÔ¡£Ê¹ÓÃSSHЭÒé¾ÙÐÐÔ¶³ÌµÇ¼¿ÉÈ·±£Êý¾ÝµÄÇå¾²´«ÊäºÍЧÀÍÆ÷µÄÇå¾²¡£×÷ΪЧÀÍÆ÷ÖÎÀíÕß £¬ÎÒÃÇÓ¦¸Ãʱ¿Ì¹ØעЧÀÍÆ÷µÄÇå¾²ÐÔ £¬°´ÆÚ¼ì²éºÍ¸üÐÂÏà¹ØÉèÖà £¬ÒÔÈ·±£Ð§ÀÍÆ÷µÄÇå¾²ÐÔºÍÎȹÌÐÔ¡£

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

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

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