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

相关推荐

  • 如何在CentOS 6上安装配置Samba

    Samba主要用于windows与Linux之间的文件共享,使用SMB/CIFS协议。CentOS 6默认安装不包括samba软件包,所以需要我们手动进行安装。 Step 1 >> 安装samba [root@localhost ~]# yum install samba -y Step 2 >> 创建一个共享用户名和密码 [root…

    Linux干货 2016-03-22
  • Nginx+Apache+Tomcat实现LANMT动静分离

    Nginx+Apache+Tomcat实现LANMT动静分离          目的:    本次实验主要目的为实现以Nginx作为反向代理,并实现分别访问动静态服务的效果。   拓扑结构:     &nbsp…

    Linux干货 2016-12-05
  • Linux下使用screen协同作业

    1)screen应用场景(拷贝自网络): 来自产品工程的高级维护用户 David 打电话说:“为什么我不能在您部署的这些新机器上编译 supercode.c”。 您会问他:“您运行的是什么机器?” David 答道:“ Posh”。(这个虚够的公司将它的 5 台生产服务器以纪念 Spice Girls 的方式命名)。这下您可以大显身手了,另一台机器由 Dav…

    系统运维 2016-08-15
  • 什么是Ansible?

    自动化工具——ansible   ansibleArchitecture ansibleProject 1. 什么是ansible ansible是个什么东西呢?官方的title是“Ansible is Simple IT Automation”——简单的自动化IT工具。这个工具的目标有这么几项:让我们自动化部署APP;自动化管理配置项;自动化的持…

    2017-09-24
  • bash循环、函数、数组、内置的字符串处理、变量、trap信号捕捉

    流程控制 过程式编程语言: 顺序执行 如果是命令写错了,可以继续往下执行;但当语法错误时则不会往下继续执行; 选择执行 循环执行 条件选择:if语句 单分支 if 判断条件;then 条件为真的分支代码 fi 双分支 if 判断条件; then 条件为真的分支代码 else 条件为假的分支代码 fi 多分支 if 判断条件1; then 条件为真的分支代码 …

    Linux干货 2017-05-21
  • Linux文件查找之find命令

    前言:        Linux文件种类繁多,难免在维护Linux中会忘记文件的路径。所有在维护Linux中学好查找命令是非常必要的。     Linux查找命令有很多,比如 whereis,type,which,locate,find(重点)。  &nbsp…

    Linux干货 2015-06-15