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)
上一篇 2016-08-04 14:40
下一篇 2016-08-04 14:41

相关推荐

  • N22-Dexter-第二周博客作业

    1、Linux上的文件管理类命令都有哪些,其常用的使用方法及其相关示例演示?    Linux上的文件管理类命令有cp,rm,mv    cp命令:copy    常用选项:       -i:交互式复制,即覆盖之前提醒用户确认;     &nbsp…

    Linux干货 2016-08-24
  • 网络接口配置–Bonding

    网络接口配置–Bonding Bonding        就是讲到快网卡绑定到同一IP地址对外服务,可以实现高可用或者负载均衡。当然,直接给两块网卡设置同一IP地址是不可能的。通过bonding,虚拟一块网卡对外提供连接,物理网卡被修改为同一MAC地址。 一 Bonding …

    Linux干货 2017-05-07
  • centos启动流程

    linux系统启动流程 内核的设计结构单内核:linux(线程–lwp轻量级进程)微内核:windows(支持真正意义上的多线程) 单内核:很多功能驱动都集成在一起 微内核:内核很小,功能单一。模块化 linux为了适应众多用户的不同硬件需求,linux内核在设计上采用模块化设计。可以动态加载模块。核心模块:ko 内核所独有的。共享对象:so 红…

    Linux干货 2016-09-09
  • lvs-keepalived

    keepalived: vrrp协议:Virtual Redundant Routing Protocol        术语:        虚拟路由器:Virtual Router &n…

    Linux干货 2017-05-13
  • GNU awk

    文本处理三工具:grep, sed, awk grep, egrep, fgrep:文本过滤工具;pattern sed: 行编辑器 模式空间、保持空间 awk:报告生成器,格式化文本输出;  AWK: Aho, Weinberger, Kernighan –> New AWK, NAWK  GNU awk, gawk&…

    Linux干货 2015-12-03
  • Linux 文 本 处 理 工 具

    Linux 文 本 处 理 工 具 一.学习大纲: ◎各种文本工具来查看、分析、统计文本文件 文件内容查看工具:cat, tac,rev,more,less 文件截取:head和tail 按列抽取:cut,paste 分析文本的工具:wc , sort , uniq,diff和patch 命令使用练习题 ◎文本过滤与处理工具: grep与正则表达式…

    Linux干货 2016-08-05