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

相关推荐

  • vim编辑器

    回顾:     正则表达式(BRE, ERE)     BRE:字符匹配:., [], [^]     次数匹配:*,\?,\+,\{m\},\{m,n}     位置锚定:^,$,\<,\>     分组及引用:(),\1,\2,…&…

    Linux干货 2016-12-23
  • 配置逻辑卷·设定LVM快照·btrfs文件系统

    _ueditor_page_break_tag_ 配置逻辑卷,设定LVM快照,btrfs文件系统                 逻辑卷管理器( LVM)v允许对卷进行方便操作的抽象层,包括重新设定文…

    Linux干货 2016-09-01
  • Linux网络属性管理(二)

    Linux网络属性(二) Linux 网络属性管理(二) ip命令 ip – show / manipulate routing, devices, policy routing and tunnels ip [ OPTIONS …

    Linux干货 2016-07-07
  • inotify介绍及rsync + inotify 实时同步备份

    1、前言 rsync (remote sync)是一款非常好的数据同步工具,能够通过对比同步双方的数据变动,实现增量同步,还可以通过LAN/WAN实现远程多台主机间文件的同步,还能结合crond任务计划来执行自动备份,又可以结合ssh实现远程数据备份的安全,种种特性使他看起来相当优秀。但如果需备份数据十分庞大时,它的不足之处就显现出来了,比如每次执…

    Linux干货 2016-06-15
  • 十一.Linux博客-2016年8月14日if、case、find

    格式说明: 操作 概念 命令 说明及举例 十一.if、case、find if 单分支if开头+条件+then+fi结尾双分支 if else fi多分枝 if elif else fi case case $num in1|3|5)echo xxx;;2|4|5)echo yyy;;*)echo nullesac 多用于离散数值匹配 文件查找和压缩 文件系…

    Linux干货 2016-08-24
  • Linux DNS服务系列之原理介绍及正反向解析配置

    前言 我们在访问一个网站的时候,只要输入该网站的网址就会跳转到该网站页面,而实现这一过程就需要DNS服务器将域名解析为IP地址,进而实现数据通信。那么DNS服务器是如何工作的呢?本系列分为两部分,本文将详解DNS服务原理及正反向解析配置。 DNS服务原理详解 DNS相关知识 DNS:Domain Name Service,域名解析服务 监听端口:udp/53…

    Linux干货 2015-04-13