[root@centos7 ~]# cp -r /etc/skel/ /home/tuser1
[root@centos7 ~]# ls -ld /home/tuser1
drwxr-xr-x. 2 root root 72 11月 27 11:30 /home/tuser1
[root@centos7 ~]# chmod -R go= /home/tuser1
[root@centos7 ~]# ls -ld /home/tuser1
drwx------. 2 root root 72 11月 27 11:30 /home/tuser1
[root@centos7 ~]# tail -1 /etc/group
hadoop:x:1009:
[root@centos7 ~]# id hadoop
id: hadoop: no such user
[root@centos7 ~]# vim /etc/passwd
[root@centos7 ~]# tail -1 /etc/passwd
hadoop:x:1009:1009::/home/hadoop:/sbin/nologin
[root@centos7 ~]# id hadoop
uid=1009(hadoop) gid=1009(hadoop) 组=1009(hadoop)
[root@centos7 ~]# install -d /etc/skel/ /home/hadoop
[root@centos7 ~]# ls -ld /home/hadoop
drwxr-xr-x. 2 root root 6 11月 27 11:54 /home/hadoop
[root@centos7 ~]# chmod go= /home/hadoop
[root@centos7 ~]# ls -ld /home/hadoop
drwx------. 2 root root 6 11月 27 11:54 /home/hadoop
[root@centos7 ~]# ls -ld /home/hadoop/
drwx------. 2 root root 6 11月 27 11:54 /home/hadoop/
[root@centos7 ~]# chown -R hadoop.hadoop /home/hadoop/
[root@centos7 ~]# ls -ld /home/hadoop/
drwx------. 2 hadoop hadoop 6 11月 27 11:54 /home/hadoop/
[root@centos7 ~]# grep "^[Ss].*" /proc/meminfo
SwapCached: 0 kB
SwapTotal: 524284 kB
SwapFree: 524284 kB
Shmem: 4660 kB
Slab: 71412 kB
SReclaimable: 34888 kB
SUnreclaim: 36524 kB
[root@centos7 ~]# grep -i "^s.*" /proc/meminfo
SwapCached: 0 kB
SwapTotal: 524284 kB
SwapFree: 524284 kB
Shmem: 4660 kB
Slab: 71412 kB
SReclaimable: 34888 kB
SUnreclaim: 36524 kB
[root@centos7 ~]# grep -v "/sbin/nologin" /etc/passwd
[root@centos7 ~]# grep "/bin/bash" /etc/passwd
[root@centos7 ~]# grep -E "\<([0-9]|[0-9][0-9])\>" /etc/passwd
[root@centos6 ~]# grep "^[[:space:]]\+.*" /boot/grub/grub.conf
[root@centos6 ~]# grep "^#[[:space:]]\+[[:alnum:]]\+" /etc/rc.d/rc.sysinit
[root@centos7 ~]# netstat -tan|grep "\<LISTEN[[:space:]]\+"
[root@centos7 ~]# grep -E "(^[[:alnum:]]+\>).*\1$" /etc/passwd
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
bash:x:1002:1002::/home/bash:/bin/bash
nologin:x:3005:3005::/home/nologin:/sbin/nologin
原创文章,作者:N24_ViCi,如若转载,请注明出处:http://www.178linux.com/61011
评论列表(1条)
排版看着还不错,作业的步骤很详细,在完成作业的同时间,记得把知识做一汇总,巩固加深印象。