第四天作业

1 、创建 用户gentoo ,附加组为bin 和root ,默认shell为/bin/csh ,注释信息为"Gentoo Distribution"

1
useradd -G bin,root -s /bin/csh -c "Gentoo Distribution" gentoo

2 、创建 下面的用户、组和组成员关系,名字为 为admins的组

用户natasha ,使用admins  作为附属组

用户harry ,也使用admins  作为附属组

用户sarah ,不可交互登录系统, 且 不是admins的成员,natasha ,harry ,sarah 密码 都是centos

1
2
3
4
5
6
useradd -G admins natasha
useradd -G admins harry
useradd -r -s /sbin/nologin sarah
echo "centos" |passwd --stdin=natasha
echo "centos" |passwd --stdin=harry
echo "centos" |passwd --stdin=sarah

3、创建testuser uid 1234,主组:bin,辅助组:root,ftp,shell:/bin/csh home:/testdir/testuser

1
useradd -u 1234 -g bin -G root,ftp -s /bin/csh -d /testdir/testuser testuser

4、修改testuser uid:4321,主组:root,辅助组:nobody,loginname:test,home:/home/test 家数据迁移

1
usermod -u 4321 -g 0 -G nobody -l test -md /home/test testuser

5、批量创建帐号:user1…user10

uid:3000-3009,shell:/bin/csh,home:/testdir/username

passwd:usernamepass

注意家目录相关配置,使用户正常登录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
touch users.txt
vi users.txt
newusers users.txt
touch passwd.txt
vi passwd.txt
cat passwd.txt |chpasswd
cp -r /etc/skel/.[^.]* /testdir/user1
cp -r /etc/skel/.[^.]* /testdir/user2
cp -r /etc/skel/.[^.]* /testdir/user3
cp -r /etc/skel/.[^.]* /testdir/user4
cp -r /etc/skel/.[^.]* /testdir/user5
cp -r /etc/skel/.[^.]* /testdir/user6
cp -r /etc/skel/.[^.]* /testdir/user7
cp -r /etc/skel/.[^.]* /testdir/user8
cp -r /etc/skel/.[^.]* /testdir/user9
cp -r /etc/skel/.[^.]* /testdir/user10


原创文章,作者:NameLess,如若转载,请注明出处:http://www.178linux.com/28169

(0)
NameLessNameLess
上一篇 2016-08-04 14:41
下一篇 2016-08-04 14:41

相关推荐

  • 磁盘分区和文件系统管理

    磁盘分区 两种分区方式:MBR,GPT  MBR: Master Boot Record,1982年,使用32位表示扇区 数,分区不超过2T  如何分区:按柱面      0磁道0扇区:512bytes      446bytes: boo…

    Linux干货 2016-08-29
  • Redis应用场景

    1.  MySql+Memcached架构的问题   实际MySQL是适合进行海量数据存储的,通过Memcached将热点数据加载到cache,加速访问,很多公司都曾经使用过这样的架构,但随着业务数据量的不断增加,和访问量的持续增长,我们遇到了很多问题:   1.MySQL需要不断进行拆库拆表,Memcached也需不断跟着扩容,扩容和维护工作占据…

    Linux干货 2016-03-22
  • corosync + pacemaker + iscsi实现高可用mysql (下)

    上一篇讲的安装配置iscsi,本章介绍mariadb安装以及高可用的mysql具体实现 一、安装配置mariadb [root@SQL1 ~]# tar xf mariadb-5.5.36-linux-x86_64.tar.gz  -C /usr/local \\解压软件包 [r…

    Linux干货 2015-07-09
  • LVS 之 初识LVS

    LVS 之 初识LVS LVS 之 初识LVS 0x00 概述 0x01 LVS拓扑结构图: lvs集群类型中的术语 : 0x02 lvs-type lvs-nat lvs-dr lvs-tun lvs-fullnat : 0x03 调度算法(scheduler) 0x00 概述 LVS : Linux Virtual Server lvs 工作在 IOS …

    2017-05-11
  • 磁盘管理

    上图sda disk information中对 255 heads,63 sectors/track,1958 cylinders的解析: sda磁盘总共有1958个cylinder(柱面),每个cylinder(柱面)有63个sectors(扇区),每个sectors(扇区)有255个heads(磁头) 那么这块sda的总的磁头数量为:255*63*19…

    2017-08-20
  • 关于大型网站技术演进的思考(十四)–网站静态化处理—前后端分离—上(6)

    原文出处: 夏天的森林  前文讲到了CSI技术,这就说明网站静态化技术的讲述已经推进到了浏览器端了即真正到了web前端的范畴了,而时下web前端技术的前沿之一就是前后端 分离技术了,那么在这里网站静态化技术和前后端分离技术产生了交集,所以今天我将讨论下前后端分离技术,前后端分离技术讨论完后,下一篇文章我将会以网站 静态化技术的角度回过头来…

    Linux干货 2015-02-26