在FreeBSD中添加用户(2)(3)

2008-02-23 08:02:59来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折



passwd
Changing local password for test.
Old password:
New password:
Retype new password:
passwd: updating the database...
passwd: done
如果用户忘了他们的口令会如何?还没有彻底完蛋,因为超级用户可以为他们更改口令;当超级用户更改其它用户的口令时,系统就不会提示他输入该用户的旧口令了:

su:
Password:

passwd test
Changing local password for test.
New password:
Retype new password:
passwd: updating the database...
passwd: done
注意,超级用户要使用用户名作为passwd工具的一个参数;如果不带用户名,那更改的就是root账号的口令了。

我要介绍的最后一个更改口令文件的工具是rmuser。该工具用于删除用户账号和任何与该用户相关的东西;所以它只能由超级用户运行。让我们来删除“test”账号:

rmuser
Enter login name for user to remove: test
Matching password entry:

test:$1$P6kMmPWG$rZiu/HfaIPVwJC6hdOImc/:1002:1002::0:0:test:/home/test:/bin/tcsh

Is this the entry you wish to remove? y
Remove user's home directory (/home/test)? y
Killed process(es) belonging to test.
Updating password file, updating databases, done.
Updating group file: (removing group test -- personal group is empty) done.
Removing user's home directory (/home/test): done.
Removing user's incoming mail file /var/mail/test: done.
Removing files belonging to test from /tmp: done.
Removing files belonging to test from /var/tmp: done.
Removing files belonging to test from /var/tmp/vi.recover: done.
看,这是个很有效的工具;它不仅从口令文件中删除用户信息,还从删除用户的主目录、邮件文件和临时目录中属于该用户的任何文件。你还应该注意到,在我删除test用户前,他的口令字段已经不是空的了,看来passwd工具已经成功更新了口令数据库。

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:在FreeBSD中添加用户(1)

下一篇:如何在 FreeBSD 下压 MP3