centos7Ôõô¿ªÆôrootȨÏÞ
centos 7 ĬÈϽûÓà root ȨÏÞ£¬¿É°´ÒÔÏ°취¿ªÆô£ºÔÝʱ¿ªÆô£ºÖÕ¶ËÊäÈë “su root”£¬ÊäÈë root ÃÜÂë¡£ÓÀÊÀ¿ªÆô£º±à¼ “/etc/ssh/sshd_config”£¬½« “permitrootlogin no” ¸ü¸ÄΪ “yes”£¬ÖØÆô ssh ЧÀÍ¡£
ÔõÑù¿ªÆô CentOS 7 ÖÐµÄ Root ȨÏÞ
CentOS 7 ĬÈϽûÓà root ȨÏÞ£¬ÎªÁËÇå¾²Ôµ¹ÊÔÓÉ¡£ÈôÊÇÄúÐèÒªÔÝʱ»òÓÀÊÀ¿ªÆô root ȨÏÞ£¬¿ÉÒÔʹÓÃÒÔÏ°취£º
ÔÝʱ¿ªÆô root ȨÏÞ
ÔÚÖÕ¶ËÖÐÊäÈëÒÔÏÂÏÂÁ
su root
µÇ¼ºó¸´ÖÆ
ÊäÈë root ÃÜÂë¡£
Íê³Éºó£¬Äú½«»ñµÃ root ȨÏÞ£¬ÏÂÁîÌáÐÑ·û»á±äΪ #¡£
Íê³ÉʹÃüºó£¬Ê¹Óà exit ÏÂÁîÍ˳ö root ȨÏÞ¡£
ÓÀÊÀ¿ªÆô root ȨÏÞ
±à¼ /etc/ssh/sshd_config Îļþ£º
vi /etc/ssh/sshd_config
µÇ¼ºó¸´ÖÆ
ÕÒµ½ÒÔÏÂÐУº
PermitRootLogin no
µÇ¼ºó¸´ÖÆ
½« no ¸ü¸ÄΪ yes¡£
ÉúÑIJ¢¹Ø±ÕÎļþ¡£
ÖØÆô SSH ЧÀÍ£º
systemctl restart sshd
µÇ¼ºó¸´ÖÆ
ÏÖÔÚ£¬Äú¿ÉÒÔʹÓà root Óû§ÃûºÍÃÜÂëͨ¹ý SSH ÅþÁ¬µ½ÏµÍ³¡£×¢ÖØ£º³öÓÚÇå¾²Ôµ¹ÊÔÓÉ£¬Ç¿ÁÒ½¨ÒéÄú½öÔÚÐèҪʱ²ÅÆôÓà root ȨÏÞ£¬²¢ÇÒÔÚÍê³ÉºóÓ¦½ûÓà root ȨÏÞ¡£
ÒÔÉϾÍÊÇcentos7Ôõô¿ªÆôrootȨÏÞµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡