FreeBSD handbook中文版 8 用户和基本的帐户管理…
2008-02-23 08:02:05来源:互联网 阅读 ()
Use option “-silent” if you don’t want to see all warnings and questions.
Check /etc/shells
Check /etc/master.passwd
Check /etc/group
Enter your default shell: csh date no sh tcsh [sh]: tcsh
Your default shell is: tcsh -> /usr/local/bin/tcsh
Enter your default HOME 分区: [/home]:
Copy dotfiles from: /usr/share/skel no [/usr/share/skel]:
Send message from file: /etc/adduser.message no
[/etc/adduser.message]: no
Do not send message
Use passwords (y/n) [y]: y
Write your changes to /etc/adduser.conf? (y/n) [n]: y
Ok, let’s go.
第4 页Enter username [a-z0-9_-]: jru
Uid [1001]:
Enter login class: default []:
Login group jru [jru]:
FreeBSD 使用手册
Don’t worry about mistakes. I will give you the chance later to correct any input.
Enter full name []: J. Random User
Enter shell csh date no sh tcsh [tcsh]:
Enter home directory (full path) [/home/jru]:
Login group is “jru”. Invite jru into other groups: guest no
[no]: wheel
Enter password []:
Enter password again []:
Name: jru
Password: ****
Fullname: J. Random User
Uid: 1007
Gid: 1007 (jru)
Class:
Groups: jru wheel
HOME: /home/jru
Shell: /usr/local/bin/tcsh
OK? (y/n) [y]: y
Added user “jru”
Copy files from /usr/share/skel to /home/jru
Add another user? (y/n) [y]: n
Goodbye!
#
总的来讲,我们把默认的shell 设置成tcsh,关闭欢迎邮件。然后,保存配置,接着创
建一个jru 的帐户,并且确信jru 在wheel 组里面。
注意:你输入的口令是不会显示出来的,而只会显示星号。确保输入两次密码时,不
第5 页FreeBSD 使用手册
要输错。从现在起,只要使用adduser,你不必改变默认设置。如果程序要求你改变默认设
置,先退出程序,然后执行程序时加上-s 选项。
8.6.2 rmuser
rmuser 能从系统中删除用户,包括超越用户数据库的任何线索。rmuser 执行下面的步
骤:
1, 删除用户的crontab 记录
2, 删除属于用户的at 工作
3, 杀掉所有属于用户的所有线程
4, 删除本地密码文件中的用户
5, 删除用户的主目录
6, 删除来自/var/mail 的属于用户的邮件
7, 删除所有诸如/tmp 的临时文件存储区中的文件
8, 最后,删除在/etc/group 中所有属于组的用户名
注意:如果一个组变成空,而组名和用户名一样,组将被删除;rmuser 不能用
来删除超级用户的帐户。
例8-2. rmuser interactive account removal
# rmuser jru
Matching password entry:
jru:*:1000:1000::0:0:J. Random User:/home/jru:/usr/local/bin/tcsh
Is this the entry you wish to remove? y
Remove user’s home directory (/home/jru)? y
Updating password file, updating databases, done.
Updating group file: trusted (removing group jru—personal group is empty) done.
Removing user’s incoming mail file /var/mail/jru: done.
Removing files belonging to jru from /tmp: done.
Removing files belonging to jru from /var/tmp: done.
Removing files belonging to jru from /var/tmp/vi.recover: done.
#
第6 页FreeBSD 使用手册
8.6.3 pw
Pw 是一个用来创建,删除,修改,显示用户和组的命令行工具,它还有系统用户和组
文件编辑器的功能。Pw 有一个非常强大的命令行设置选项,但新用户可能会觉得它比这儿
讲的其它命令要复杂得多。
8.6.4 chpass
Chpass 可以改变用户的密码,shells,和个人信息的数据库信息。只有超级用户才能改
变其它用户的信息。除了可选择的用户名,不需要任何选项,chpass 显示一个包含用户信息
的编辑器,而且可以试图改变在用户数据库中的信息。
例如8-3. Interactive chpass by Superuser
#Changing user database information for jru.
Login: jru
Password: *
Uid [#]: 1000
Gid [# or name]: 1000
Change [month day year]:
Expire [month day year]:
Class:
Home directory: /home/jru
Shell: /usr/local/bin/tcsh
Full Name: J. Random User
Office Location:
Office Phone:
Home Phone:
Other information:
The normal user can change only a small subsection of this information, and only for
themselves.
例如8-4. Interactive chpass by Normal User
#Changing user database information for jru.
Shell: /usr/local/bin/tcsh
第7 页FreeBSD 使用手册
Full Name: J. Random User
Office Location:
Office Phone:
Home Phone:
Other information:
8.6.5 passwd
passwd 是改变你自己的密码的常用方法。
注意:在改变密码前用户必须键入原来的密码。当使用者离开他们的控制台时,可以阻
止一个没有经过认证的人改变他们的密码。
例如8-5. passwd
% passwd
Changing local password for jru.
Old password:
New password:
Retype new password:
passwd: updating the database...
passwd: done
# passwd jru
Changing local password for jru.
New password:
Retype new password:
passwd: updating the database...
passwd: done
8.7 受限制的用户
如果你运行一个多用户系统,你不信任的用户对系统所作的修改可能会损坏你的系统。
FreeBSD 提供了系统管理员限制用户访问系统资源的方法。这些限制通常被分成两种:磁盘
配额和其他资源限制。磁盘配额为系统管理员提供了一个告诉文件系统给用户使用多少磁盘
空间的方法。而且,它还提供了一种快速检查用户所使用的磁盘数量而不需要时刻计算的方
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash
