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
下一篇 2016-08-04

相关推荐

  • 推荐-Linux命令帮助的获取

    帮助命令 1. 使用帮助命令和帮助选项来获取帮助 2. 使用man来查看命令使用手册(manual) 3. 使用info来查看命令的信息页 4. 程序自身的帮助文档 5. 程序官方文档 6. 发行版的官方文档 7. 使用Google搜索关键字 1. 使用帮助命令和帮助选项来获取帮助 Linux系统中命令分为【内部命令】和【外部命令】。 【内部命令】:内部命令…

    Linux干货 2016-03-25
  • 22期第十二周课堂练习

    1、请描述一次完整的http请求处理过程; (1)建立和处理连接:接收请求或者拒绝请求; (2)接收请求:接收来自于网络上的主机请求报文中对某特定的资源的一次请求的过程; (3)处理请求:对请求报文进行解析,获取客户端请求的资源及请求方法等相关信息 (4)访问资源:获取请求报文中请求的资源 (5)构建响应报文; (6)发送响应报文; (7)记录日志; 2、h…

    Linux干货 2016-12-26
  • class17 网络管理(二)

    IP 地址 它们可唯一标识IP网络中的每台设备 每台主机(计算机、网络设备、外围设备)必须具有唯一的地址           IP 地址由两部分组成:     • 网络ID:   …

    Linux干货 2016-09-06
  • 删除并恢复

    1.删除/lib64/libc.so.6 ,并恢复之。 centos7.3:重启→进入救援模式→cd  lib64→cp libc.so.6  /mnt/sysimage/lib64 →exit,选择第二个白条(救援),即可恢复; centos6.9:重启→进入救援模式→cd  lib64→cp libc.so.6  …

    2017-06-11
  • 学习宣言

    世界上没有笨的人,只有不勤奋的人。严格按照学习计划要求自己,努力完成学业,为自己以后的职业发展铺平道路;

    Linux干货 2016-10-25
  • centos 7.2 安装pyenv多版本管理工具和虚拟环境pyenv-virtualenv

    软件简介: pyenv + pyenv-virtualenv pyenv,是一款特别好用的Python版本管理器,程序员可以建立不同的目录,在不同的目录里分别运行不同版本的Python, 并且互不影响,安装的包也互不影响。github项目地址:https://github.com/yyuu/pyenv pyenv-virtualenv, 是pyenv的一个p…

    Linux干货 2016-07-04