欢迎访问 生活随笔!

ag凯发k8国际

当前位置: ag凯发k8国际 > 运维知识 > ubuntu >内容正文

ubuntu

ubuntu修改root密码以及允许证书和密码登陆 -ag凯发k8国际

发布时间:2024/9/30 ubuntu 10 豆豆
ag凯发k8国际 收集整理的这篇文章主要介绍了 ubuntu修改root密码以及允许证书和密码登陆 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

1:修改sshd_config 

root@micro-node3:~# cd /etc/ssh/
root@micro-node3:/etc/ssh# cat sshd_config 

# package generated configuration file # see the sshd_config(5) manpage for details# what ports, ips and protocols we listen for port 22 # use these options to restrict which interfaces/protocols sshd will bind to #listenaddress :: #listenaddress 0.0.0.0 protocol 2 # hostkeys for protocol version 2 hostkey /etc/ssh/ssh_host_rsa_key hostkey /etc/ssh/ssh_host_dsa_key hostkey /etc/ssh/ssh_host_ecdsa_key hostkey /etc/ssh/ssh_host_ed25519_key #privilege separation is turned on for security useprivilegeseparation yes# lifetime and size of ephemeral version 1 server key keyregenerationinterval 3600 serverkeybits 1024# loggingloglevel info# authentication: logingracetime 120 #--! permitrootlogin prohibit-password strictmodes yesrsaauthentication yes pubkeyauthentication yes #authorizedkeysfile %h/.ssh/authorized_keys# don't read the user's ~/.rhosts and ~/.shosts files ignorerhosts yes # for this to work you will also need host keys in /etc/ssh_known_hosts rhostsrsaauthentication no # similar for protocol version 2 hostbasedauthentication no # uncomment if you don't trust ~/.ssh/known_hosts for rhostsrsaauthentication #ignoreuserknownhosts yes# to enable empty passwords, change to yes (not recommended) permitemptypasswords no# change to yes to enable challenge-response passwords (beware issues with # some pam modules and threads) challengeresponseauthentication no# change to no to disable tunnelled clear text passwords# kerberos options #kerberosauthentication no #kerberosgetafstoken no #kerberosorlocalpasswd yes #kerberosticketcleanup yes# gssapi options #gssapiauthentication no #gssapicleanupcredentials yesx11forwarding yes x11displayoffset 10 printmotd no printlastlog yes tcpkeepalive yes #uselogin no#maxstartups 10:30:60 #banner /etc/issue.net# allow client to pass locale environment variables acceptenv lang lc_*subsystem sftp /usr/lib/openssh/sftp-server# set this to 'yes' to enable pam authentication, account processing, # and session processing. if this is enabled, pam authentication will # be allowed through the challengeresponseauthentication and # pam authentication via challengeresponseauthentication may bypass # the setting of "permitrootlogin without-password". # if you just want the pam account and session checks to run without # and challengeresponseauthentication to 'no'. usepam yesusedns no addressfamily inet syslogfacility authpriv permitrootlogin yes passwordauthentication no

修改最后一行为passwordauthentication yes

2:修改root密码

修改root密码

  1. sudo passwd  

  2. enter new unix password:  

  3. retype new unix password:  

 4. passed:finished update successfully.

总结

以上是ag凯发k8国际为你收集整理的ubuntu修改root密码以及允许证书和密码登陆的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得ag凯发k8国际网站内容还不错,欢迎将ag凯发k8国际推荐给好友。

网站地图