易截截图软件、单文件、免安装、纯绿色、仅160KB

Howto: Linux Add User To Group (tips)

Q. How can I add a user to a group under Linux operating system?
A. You can use useradd or usermod commands to add a user to a group. useradd command creates a new user or update default new user information. usermod command modifies a user account i.e. it is useful to add user to existing group. There are two types of group. First is primary user group and other is secondary group. All user account related information is stored in /etc/passwd, /etc/shadow and /etc/group files to store user information.
useradd example - Add a new user to secondary group
Use useradd command to add new users to existing group (or create a new group and then add user). If group does not exist, create it. Syntax:
useradd -G {group-name} username
Create a new user called vivek and add it to group called developers. First login as a root user (make sure group developers exists), enter:
# grep developers /etc/group
Output:
developers:x:1124:
If you do not see any output then you need to add group developers using groupadd command:
# groupadd developers
Next, add a user called vivek to group developers:
# useradd -G developers vivek
Setup password for user vivek:
# passwd vivek
Ensure that user added properly to group developers:
# id vivek
Output:
uid=1122(vivek) gid=1125(vivek) groups=1125(vivek),1124(developers)
Please note that capital G (-G) option add user to a list of supplementary groups. Each group is separated from the next by a comma, with no intervening whitespace. For example, add user jerry to groups admins, ftp, www, and developers, enter:
# useradd -G admins,ftp,www,developers jerry
useradd example - Add a new user to primary group
To add a user tony to group developers use following command:
# useradd -g developers tony
# id tony
uid=1123(tony) gid=1124(developers) groups=1124(developers)
Please note that small -g option add user to initial login group (primary group). The group name must exist. A group numb


相关文档:

linux下更改共享内存的最大值

System V
IPC
参数


名字
描述
合理取值


SHMMAX
最大共享内存段尺寸(字节)
最少若干兆(见文本)
SHMMIN
最小共享内存段尺寸(字节)
1
SHMALL
可用共享内存的总数量(字节或者页面)
如果是字节,就和 SHMMAX
一样;如果是页面,ceil(SHMMAX/P ......

linux修改mac地址

1)闭网卡设备
  /sbin/ifconfig eth0 down
2)修改MAC地址
  /sbin/ifconfig eth0 hw ether 00:50:56:C0:00:01
3)重启网卡
  /sbin/ifconfig eth0 up
通过ifconfig可以看到修改已经生效,可是重启机器后又恢复成了原来得mac.
要想永久修改MAC
在/etc/rc.d/rc.local里加上这三句(也可以在/etc/init.d/networ ......

七大实用命令行工具 玩转Linux网络配置

【51CTO精选译文】虽然现在大多数Linux发行版下都有GUI的网络管理配置,不过熟悉命令行工具还是大有助益的。下面我们来看看这些流行Linux发行版下面的常用命令。对了,如果你想要了解该工具和选项的详细情况,可以输入man再输入这个工具的名字访问其man页面。
现在就打开你的terminal尝试一下吧!
用于基本接口与IP配置的 ......

Linux管理员不可不知的五大命令+工具

【51CTO精选译文】对于Linux管理员来说,有很多非常有用的工具可供选择。在这里,我只是列举出其中5个,Linux管理员日常操作都要用到的工具。我认为,功能最强的工具可能并不适合你的使用情况,而且绝对有些工具我还忘了把它们统计进来,如果是这样的话,我恳请大家把我没收录的工具在评论中写出来。另外,本文中提到的工具 ......

2440平台下linux串口开发源码示例(2440双串口间通信)

/***************************************************************************** 程序说明:示例程序演示了2440平台下linux串口应用开发,可实现2440串口2与串口3的通讯*** 硬件设置:将2440板子上的串口2、3TXD、RXD交叉短接*** 编译运行:在宿主机上编译程序源码,打开超级终端(可与2440进行命令交互),*** &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号