8.1作业习题

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

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

2.修改testuser uid:4321,主组:root,辅助组:nobody,name:test,home:/home/test 家数据迁移

usermod -u 4321 -g root -G nobody -l test -d /home/test -m testuser

3.批量创建帐号:user1…user10

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

passwd:usernamepass

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

vi user.txt

user1:x:3000:3000::/testdir/username:/bin/csh

user2:x:3001:3001::/testdir/username:/bin/csh

user3:x:3002:3002::/testdir/username:/bin/csh

user4:x:3003:3003::/testdir/username:/bin/csh

user5:x:3004:3004::/testdir/username:/bin/csh

user6:x:3005:3005::/testdir/username:/bin/csh

user7:x:3006:3006::/testdir/username:/bin/csh

user8:x:3007:3007::/testdir/username:/bin/csh

user9:x:3008:3008::/testdir/username:/bin/csh

user10:x:3009:3009::/testdir/username:/bin/csh

newusers user.txt

vi p.txt

user1:usernamepass

user2:usernamepass

user3:usernamepass

user3:usernamepass

user4:usernamepass

user5:usernamepass

user6:usernamepass

user7:usernamepass

user8:usernamepass

user9:usernamepass

user10:usernamepass

cat p.txt |chpasswd

cp -r /etc/sk1/.[^.]* /testdir/username/user1

cp -r /etc/sk1/.[^.]* /testdir/username/user2

cp -r /etc/sk1/.[^.]* /testdir/username/user3

cp -r /etc/sk1/.[^.]* /testdir/username/user4

cp -r /etc/sk1/.[^.]* /testdir/username/user5

cp -r /etc/sk1/.[^.]* /testdir/username/user6

cp -r /etc/sk1/.[^.]* /testdir/username/user7

cp -r /etc/sk1/.[^.]* /testdir/username/user8

cp -r /etc/sk1/.[^.]* /testdir/username/user9

cp -r /etc/sk1/.[^.]* /testdir/username/user10

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

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

相关推荐

  • N25第二周作业 文件管理类命令cp mv rm以及 bash特性之文件名通配

    Linux上的文件管理类命令都有哪些,其常用的使用方法及其相关示例演示。         文件管理类命令主要有cp, mv, rm          cp用于单个文件的复制,例如:  &nb…

    Linux干货 2016-12-13
  • grep虐我千百遍,我待grep如初恋

    N21第四周博客作业 1、  复制/etc/skel目录为/home/tuser1,要求/home/tuser1及其内部文件的属组和其它用户均没有任何访问权限。 [root@Centos6 ~]# cp -r /etc/skel /home/tuser1 [root@Centos6 ~]#…

    Linux干货 2016-07-16
  • 2017-10-4Linux基础知识(3)

    在上一章中讲到了操作系统的历史的发展以及Linux的如何诞生,在1991年的8月份,创始人Linus宣布成立Linux的,Larry Wall开发diff和patch打补丁的命令程序使得Linux可以在安全性方面有很大的提升。

    Linux干货 2017-10-05
  • Centos Linux基础入门知识类

    Centos Linux基础入门知识类 •1.1Linux终端介绍 •1.2基本命令的使用:ls、pwd、cd。 •1.3 查看系统和BIOS硬件时间。 •1.4 Linux如何获得帮助,Linux关机命令:shutdow、init等。 •1.5 YUM本地源配置与开机自动挂载光盘 前言: 很多学习Linux的同学或多…

    Linux干货 2017-03-26
  • keepalived高可用lvs集群

    实验拓扑   keepalived高可用配置 HA01和HA02的keepalived安装及配置(安装及配置均相同) ~]# yum -y install keepalived HA01和HA02做时间同步,crontab中添加时间同步脚本 ~]# date; ssh 192.168.150.140 'date'   …

    Linux干货 2016-12-06
  • Linux发展与应用

                                                      &nbsp…

    2017-04-05