重置Centos 7系统密码

如何重置Centos 7系统密码呢?

重启系统在引导菜单中,按e编辑现有内核

重置Centos 7系统密码


接下来,向下滚动到列表,直到看到下面(ro)下划线的行。我们需要做的是将这个ro改为rw并开始执行一个bash shell。它应该看起来像这样rwinit=/sysroot/bin/sh

重置Centos 7系统密码

重置Centos 7系统密码

ro行更改为rw并添加init=/sysroot/bin/sh
rw init=/sysroot/bin/sh


改变之后,按键盘上的Control + X  或Ctrl + X使用上面指定的bash shell启动到单用户模式。在这种模式下,我们将更改根密码 
在单用户模式下,运行如下所示的命令
chroot /sysroot

重置Centos 7系统密码


最后,运行下面的命令来更改root密码

重置Centos 7系统密码


系统会提示您创建并确认新密码。创建密码后,运行以下命令更新SELinux参数
touch /.autorelabel

退出并重新启动系统

此文章来自固定链接:http://www.rakbuluo.com/p21/

原文链接:,转发请注明来源!

发表评论

  • 13 Responses to “重置Centos 7系统密码”
    • viagra online canadian pharmacy eclzdo

      northwestpharmacy.com scam <a href="http://edpharmacystore.com/">click this link</a> canadianpharmacymeds.com
      <a href=http://edpharmacystore.com/>company website</a>

      回复
    • drugstore canada tacehv

      cialis from canadian pharmacy <a href="http://edpharmacystore.com/">internet</a> internet pharmacy
      <a href=http://edpharmacystore.com/>canadian pharmacies online http://edpharmacystore.com/</a>

      回复
    • CharlesHob

      tinder dating app , how to use tinder
      <a href=http://tinderdatingsiteus.com/?>how to use tinder </a>

      回复
    • step by step guide to growing indoor marijuana

      The back of one door is the face of another.

      回复
    • super skunk

      Prudent men woo thrifty women.

      回复
    • prescription drugs from canada gsqhmt

      viagra without a doctor prescription in canada <a href=http://www.canada1drugstore.com/tadalafil/>rx canada</a> viagra stories
      <a href="http://www.canada1drugstore.com/tadalafil/">viagra results</a> canada-cialis

      回复
    • canada online pharmacies thtmxo

      viagra use <a href=http://www.canada1drugstore.com/tadalafil/>buy drugs</a> canadian pharmacy cialis
      <a href="http://www.canada1drugstore.com/tadalafil/">adhp</a> drug store

      回复
    • gidrasajt4afHelp

      <a href="https://gidrasajt4af.com">gidrasajt4af.com</a> представляет собой магазин, который предназначен для магазинов незаконных веществ и услуг. Подобную услугу нельзя купить в традиционном интернет-магазине, потому что это нелегально.

      回复
    • Tinder dating site

      tinder dating app , tindr
      <a href=http://tinderdatingsiteus.com/?>tider </a>

      回复
    • Charlesedity

      cialis pharmacy <a href="https://www.instapaper.com/p/beasleyabdi8">buy viagra online without a prescription</a> cheap cialis online canadian pharmacy <a href=https://cutt.us/tVK5b>buy cialis</a> canada drug prices
      viagra coupons <a href="http://zimmermanmartinsen7.over-blog.com/2021/01/the-most-unique-tips-for-losing-more-weight.html">canadian pharmacy online for viagra</a> viagra 100 mg <a href=http://bookmarkloves.com/story7291981/take-control-of-your-health-with-these-great-acid-reflux-tips>viagra prescriptions</a> lowest prescription prices
      real viagra online <a href="https://bookmarkzones.trade/story.php?title=one-of-the-most-unique-tips-for-losing-more-weight-3#discuss">how does viagra work</a> onlinepharmaciescanada.com <a href=https://disqus.com/by/gissel96gissel/>viagra over the counter</a> the canada pharmacy
      uk viagra sales

      回复
    • tinder dating

      tinder login, tindr

      回复
    • Datingkal

      https://freedatingsiteall.com
      free dating websites,dating online free
      out dating websites
      <a href=https://freedatingsiteall.com>free dating online</a>

      回复
    • Stephenpeaky

      viagra doses 200 mg <a href=" http://sild100fast.com/# ">viagra</a> viagra prescription

      回复