今天给大家介绍下passwd这个命令的简单用法,我们man一下,看到下面有这么多选项参数可以使用:
SYNOPSIS
passwd有这么多选项,其实我们用的最多的几个选项参数是下面几个
-l This option is used to lock the specified account and it is available to root only. The locking is performed by rendering the encrypted password into an invalid string (by prefixing the encrypted string with an !). -l 参数是用来锁住某个账户的,用户安全方面
-u This is the reverse of the -l option – it will unlock the account password by removing the ! prefix. This option is available to root only. By default passwd will refuse to create a passwordless account (it will not unlock an account that has only "!" as a password). The force option -f will override this protection. -u 参数是用来解锁某个账户的,和-l参数正好相反
-d This is a quick way to delete a password for an account. It will set the named account passwordless. Available to root only. -d 参数是用来删除某个用户的密码,只有root才能使用
-e This is a quick way to expire a password for an account. The user will be forced to change the password during the next login attempt. Available to root only. -e 参数是用来强制某个用户下次登录的时候必须修改密码
其他参数用的不是很多,上面是一些常用的参数的用法和介绍,感兴趣的朋友可以去试验下。 (责任编辑:IT) |