juaner's Blog

千里之行,始于足下。

用户与组群账号管理

juaner posted @ Sun, 02 Oct 2011 16:19:30 +0800 in linux , 1502 readers

用户账号信息:

    通常Linux中的所有用户账号数据全部记录在/etc/passwd文件中,要查看里面的内容,切换到root账户,输入vi /etc/passwd即可查看。

其中每个账号包含7种字段,分别为登录名称,密码,UID,GID,账号信息,主目录和登录shell。

    另外也可以使用图形化工具——用户管理者,可以单击应用程序|系统设置|用户与组群,也可以输入system-config-users命令打开。

    如果网络属于高安全性要求的环境,而且目前没有采取任何网络验证架构,应该考虑使用Shadow的方式来加强验证系统文件的安全性,也就是的“Shadow Password”。fedora安装时,默认启用Shadow Password以及MD5的密码保护功能。输入vi /etc/shadow可以查看该文件。

组群账号信息:

    保存在/etc/group中,每一行代表一个组群的账号信息,包含4中字段,意义分别为:组群账号名称,密码,ID以及用户列表。与此对应得应该有一个/etc/gshadow。

添加账号

    可以通过编辑/etc/passwd来添加账号,但是很麻烦,如果存在/etc/shadow,编辑内容会失效。

建议使用useradd或者是adduser命令添加用户账户。adduser命令指示useradd命令的一个链接,二者的功能完全相同。

    在添加账户前可以使用finger命令来查看一下是不是已经存在这个账户,方法如 finger zhao,可以查看一下zhao这个账户是不是已经存在。

添加账号的语法有以下两种:

  1. useradd alice(即为新加的账号)。
  2. 使用useraddd加参数。

另外可以用工具栏上的“添加用户”按钮。

修改用户账号

    命令为usermod.参数与上面的相似。

添加组群账号:

    groupadd命令,没有addgroup。

    可以用-g参数设置GTD,如果冲突,可以使用-o取代原来的。

    也可以用“添加组群”按钮实现。

密码管理:

    命令passwd.

    删除密码:passwd -d jake.

    锁定账号(Lock):passwd -l jake.

    打开锁定的账号(UNlock):passwd -u jake.如果账号没有密码,需要: passwd -u -f jake.

    显示账号密码信息,是否锁定:passwd -S jake。

常用命令

    whoami;w;who;chfn;write.

write可以传输消息给其他登录的用户。

   如write zhao 回车

     Hello.

     输入完后回车按Ctrl+D表示信息结束。

 

  

 

 

 

 

 

   

Avatar_small
meidir said:
Sun, 04 Dec 2022 22:44:55 +0800

This is a great blog” and i want to visit this every day of the week .    二手notebook

 

=================

 

Thank you for the sensible critique. Me and my friend were just preparing to do a little research on this. We got a book from our area library but I think I learned more from this post. I am very glad to see such magnificent information being shared freely out there.. 스포츠토토

Avatar_small
meidir said:
Thu, 12 Jan 2023 02:00:36 +0800

The next time I just read a weblog, I really hope which it doesnt disappoint me up to this one. Get real, Yes, it was my choice to read, but I personally thought youd have something interesting to convey. All I hear can be a handful of whining about something you could fix in the event you werent too busy trying to find attention. 온라인바카라

Avatar_small
meidir said:
Sun, 19 Feb 2023 14:03:00 +0800

Fantastic short article! Genuinely loved the exact digesting. I hope you just read a bit more from your site. My partner and i you will have superb understanding and in addition visualization. I am just particularly delighted utilizing this knowledge. 슈어맨

Avatar_small
meidir said:
Wed, 23 Aug 2023 23:38:20 +0800

Hi there, Might I export your own photograph and use it on my own webpage? 插花課程


Login *


loading captcha image...
(type the code from the image)
or Ctrl+Enter