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

相关推荐

  • iptables学习笔记   Netfilter:是Linux操作系统核心层内部的一个数据包处理模块。   Hook point:数据包在Netfilter中的挂载点。(PRE_ROUTIN   ,INPUT,OUTPUT,FORWARD,POST_ROUTING)   iptables 规则组成:四张表+五条链(Ho…

    Linux干货 2016-12-05
  • vsftpd基于mysql存储认证(centos7)

    (1)首先开发包组和服务器平平台开发包组 (2)yum安装需要的依赖包 (3)编译安装pam_mysql模块 (4)配置mysql,并添加mysql中的vsftpd进程用户,且创建vsftpd数据库,并将vsftpd数据库授权给vsftpd用户,且创建vsftpd.users表,并在表中添加用户tom (5)创建vsftpd要上传和下载的URL (6)创建基…

    Linux干货 2016-10-15
  • LVM2

    LVM2:         LVM: Logical Volume Manger, Version:2        dm: device mapper, 将一个或多个底层块设备组织 成一个逻辑设备的模块;           &…

    Linux干货 2016-12-30
  • OPenSSL

    OPenSSL   OpenSSL 是一个安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及SSL协议,并提供丰富的应用程序供测试或其它目的使用.   SSL是Secure Sockets Layer(安全套接层协议)的缩写,可以在Internet上提供秘密性传输。Netscape公司在推出第一个Web浏览器的同时,提出了SSL协议标准。…

    Linux干货 2016-11-07
  • 简单shell脚本编程示例

    1、编写脚本/root/bin/systeminfo.sh,显示当前主机系统信息,包括主机名,IPv4地址,操作系统版本,内核版本,CPU型号,内存大小,硬盘大小。 脚本内容: 执行结果: 2、编写脚本/root/bin/backup.sh,可实现每日将/etc/目录备份到/root/etcYYYY-mm-dd中 脚本内容: 执行结果: 3、编写脚本/roo…

    Linux干货 2016-08-15
  • date命令常见用法。

    date是一个非常实用的小工具,可以查看时间,并且也可以添加选项去完成自己想完成的东西。

    Linux干货 2017-11-13