标签:lis ext sysinit 执行 log roc 复制 相同 大写
[root@centos7 ~]#cp -rv /etc/skel/ /home/tuser1
‘/etc/skel/’ -> ‘/home/tuser1’
‘/etc/skel/.mozilla’ -> ‘/home/tuser1/.mozilla’
‘/etc/skel/.mozilla/extensions’ -> ‘/home/tuser1/.mozilla/extensions’
‘/etc/skel/.mozilla/plugins’ -> ‘/home/tuser1/.mozilla/plugins’
‘/etc/skel/.bash_logout’ -> ‘/home/tuser1/.bash_logout’
‘/etc/skel/.bash_profile’ -> ‘/home/tuser1/.bash_profile’
‘/etc/skel/.bashrc’ -> ‘/home/tuser1/.bashrc’
[root@centos7 ~]#chmod -R 700 /home/tuser1/
[root@centos7 ~]#ll -a /home/tuser1/
total 12
drwx------. 3 root root 78 Jul 14 17:19 .
drwxr-xr-x. 11 root root 133 Jul 14 17:19 ..
-rwx------. 1 root root 18 Jul 14 17:19 .bash_logout
-rwx------. 1 root root 193 Jul 14 17:19 .bash_profile
-rwx------. 1 root root 231 Jul 14 17:19 .bashrc
drwx------. 4 root root 39 Jul 14 17:19 .mozilla
[root@centos7 ~]#vim /etc/group
-使用vim编辑器打开/etc/group文件,输入G跳转到最后一行,然后输入o进入编辑模式,添加:hadoop:x:5004后点击esc键后输入:wq,保存退出。
[root@centos7 ~]#tail -1 /etc/group
hadoop:x:5004
[root@centos7 ~]#vim /etc/passwd
-使用vim编辑器打开/etc/passwd文件,输入G跳转到最后一行,然后输入o进入编辑模式,添加hadoop:x:2003:5004::/home/hadoop:/bin/bash后点击esc键后输入:wq,保存退出:
[root@centos7 ~]#tail -1 /etc/passwd
hadoop:x:2003:5004::/home/hadoop:/bin/bash
[root@centos7 ~]#cp -rv /etc/skel/ /home/hadoop
‘/etc/skel/’ -> ‘/home/hadoop’
‘/etc/skel/.mozilla’ -> ‘/home/hadoop/.mozilla’
‘/etc/skel/.mozilla/extensions’ -> ‘/home/hadoop/.mozilla/extensions’
‘/etc/skel/.mozilla/plugins’ -> ‘/home/hadoop/.mozilla/plugins’
‘/etc/skel/.bash_logout’ -> ‘/home/hadoop/.bash_logout’
‘/etc/skel/.bash_profile’ -> ‘/home/hadoop/.bash_profile’
‘/etc/skel/.bashrc’ -> ‘/home/hadoop/.bashrc’
[root@centos7 ~]#chmod 700 /home/hadoop/
[root@centos7 ~]#chown -R hadoop:hadoop /home/hadoop/
[root@centos7 ~]#ll -a /home/hadoop/
total 12
drwx------. 3 hadoop hadoop 78 Jul 14 20:24 .
drwxr-xr-x. 12 root root 147 Jul 14 20:24 ..
-rw-r--r--. 1 hadoop hadoop 18 Jul 14 20:24 .bash_logout
-rw-r--r--. 1 hadoop hadoop 193 Jul 14 20:24 .bash_profile
-rw-r--r--. 1 hadoop hadoop 231 Jul 14 20:24 .bashrc
drwxr-xr-x. 4 hadoop hadoop 39 Jul 14 20:24 .mozilla
第一种方式:
[root@centos7 ~]#grep ^[sS] /proc/meminfo
SwapCached: 0 kB
SwapTotal: 2097148 kB
SwapFree: 2097148 kB
Shmem: 7416 kB
Slab: 75744 kB
SReclaimable: 28976 kB
SUnreclaim: 46768 kB
第二种方式:
[root@centos7 ~]#grep -i ^s /proc/meminfo
SwapCached: 0 kB
SwapTotal: 2097148 kB
SwapFree: 2097148 kB
Shmem: 7416 kB
Slab: 75744 kB
SReclaimable: 28976 kB
SUnreclaim: 46768 kB
显示/etc/passwd文件中其默认shell为非/sbin/nologin的用户;
显示/etc/passwd文件中其默认shell为/bin/bash的用户;
找出/etc/passwd文件中的一位数或两位数;
显示/boot/grub/grub.conf中以至少一个空白字符开头的行;
显示/etc/rc.d/rc.sysinit文件中以#开头,后面跟至少一个空白字符,而后又有至少一个非空白字符的行;
打出netstat -tan命令执行结果中以‘LISTEN’,后或跟空白字符结尾的行;
添加用户bash, testbash, basher, nologin (此一个用户的shell为/sbin/nologin),而后找出当前系统上其用户名和默认shell相同的用户的信息;
标签:lis ext sysinit 执行 log roc 复制 相同 大写
原文地址:https://www.cnblogs.com/iamvipwang/p/9310904.html