在Fedora Linux上如何更改root密码

时间:2019-11-20 08:52:47  来源:igfitidea点击:

在Fedora Linux上如何更改root密码?

Fedora Linux更改root密码命令

登录到Fedora Linux 27.x/28.x/29.x服务器:

ssh Hyman@fedora29

执行passwd命令

[Hyman@fedora29:~ ]$ sudo passwd root

如何更改其他用户的密码?

语法为:

sudo passwd userNameHere
sudo passwd Hyman

如何更改自己的密码?

只需执行:

passwd

总结

本页说明了在Fedora Linux上使用passwd命令更改root用户密码的过程。
有关更多信息,请通过执行以下man命令来查看passwd命令手册页:

man passwd
passwd --help
Usage: passwd [OPTION...] <accountName>
  -k, --keep-tokens       keep non-expired authentication tokens
  -d, --delete            delete the password for the named account (root only); also removes password lock if any
  -l, --lock              lock the password for the named account (root only)
  -u, --unlock            unlock the password for the named account (root only)
  -e, --expire            expire the password for the named account (root only)
  -f, --force             force operation
  -x, --maximum=DAYS      maximum password lifetime (root only)
  -n, --minimum=DAYS      minimum password lifetime (root only)
  -w, --warning=DAYS      number of days warning users receives before password expiration (root only)
  -i, --inactive=DAYS     number of days after password expiration when an account becomes disabled (root only)
  -S, --status            report password status on the named account (root only)
      --stdin             read new tokens from stdin (root only)
 
Help options:
  -?, --help              Show this help message
      --usage             Display brief usage message