Marco 2016 new Linux+python high-end Operation fourth week

Source: Internet
Author: User

1, the Replication/etc/skel directory is/home/tuser1, requires/home/tuser1 and its internal files belong to the group and other users do not have any access rights.

A: ① copy files and view their permissions 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/86/80/wKiom1fBDirxh2sJAAAp6PYxgZI373.jpg "Title=" 1.jpg "alt=" wkiom1fbdirxh2sjaaap6pyxgzi373.jpg "/>② Modify permissions for/home/tuser1

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/86/80/wKioL1fBEGqQYzbvAABMPZtBMWM361.jpg "title=" 1.jpg " alt= "Wkiol1fbegqqyzbvaabmpztbmwm361.jpg"/>

2. Edit the/etc/group file and add the group Hadoop.

A: Use Vim to edit the/etc/group, add Hadoop to the file in the format, and then save the exit;

[Email protected] ~]# Vim/etc/group

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/86/80/wKiom1fBHXyDrpyuAAAQKb6sFrc305.jpg "title=" 1.jpg " alt= "Wkiom1fbhxydrpyuaaaqkb6sfrc305.jpg"/>

Extensions: You can also use echo to add directly

650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M00/86/80/wKiom1fBHbbjjeQgAAAdiH1QRaE309.jpg "title=" 1.jpg " alt= "Wkiom1fbhbbjjeqgaaadih1qrae309.jpg"/>

3. Manually edit the/ETC/PASSW D file to add a new line, adding user Hadoop, whose basic group ID is the Hadoop group ID number; its home directory is/home/hadoop.

Answer: VI Edit/etc/passwd file

[Email protected] ~]# Vim/etc/group

Enter the following information:

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/86/80/wKioL1fBKMXxhsY6AAAhcKH4HZk342.jpg "title=" 11.jpg "alt=" Wkiol1fbkmxxhsy6aaahckh4hzk342.jpg "/>

Extensions: You can also use the Echo method to add

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/86/80/wKiom1fBKVHg-TLwAAAwWlG9iTY993.jpg "title=" 1.jpg " alt= "Wkiom1fbkvhg-tlwaaawwlg9ity993.jpg"/>

4. Copy the/etc/skel directory as/home/hadoop, which requires that the genus Group and other users of the Hadoop directory be modified without any access rights.

Answer: 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/86/80/wKioL1fBK2qxM0gwAAB_FIoujOQ878.jpg "title=" 1. JPG "alt=" wkiol1fbk2qxm0gwaab_fioujoq878.jpg "/>

5, modify the/home/hadoop directory and all the internal files of the owner of Hadoop, belong to Hadoop group.

Answer: # chown-r Hadoop:hadoop/home/hadoop

6. Display the lines in the/proc/meminfo file beginning with uppercase or lowercase s, in two ways;

A: ① query 650 with grep case-insensitive) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/86/81/ Wkiol1fbuohtbkafaaapu-yqkge365.jpg "title=" 1.jpg "alt=" Wkiol1fbuohtbkafaaapu-yqkge365.jpg "/>

② using an extended regular expression

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/86/81/wKiom1fBWPDz68KWAAAdyUTER5I122.jpg "title=" 1.jpg " alt= "Wkiom1fbwpdz68kwaaadyuter5i122.jpg"/>

7. Display/ETC/PASSW D file whose default shell is non-/sbin/nologin user;

Answer: 650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/86/81/wKiom1fBWwfiePWuAACFO9IeVhk231.jpg "title=" 1. JPG "alt=" wkiom1fbwwfiepwuaacfo9ievhk231.jpg "/>

8. Display the user whose default shell is/bin/bash in/ETC/PASSW D file;

Answer: 650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/82/wKiom1fBZ-zTZ9p_AAA1jYWW1RQ770.jpg "title=" 1. JPG "alt=" wkiom1fbz-ztz9p_aaa1jyww1rq770.jpg "/>

9. Find out one or two digits in/ETC/PASSW D file;

Answer: 650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/86/82/wKioL1fBi-WgnL3hAAF8O6IZU1Y910.jpg "title=" 1. JPG "style=" float:left; "alt=" wkiol1fbi-wgnl3haaf8o6izu1y910.jpg "/>

10. Display the line beginning with at least one blank character in/boot/grub/grub.conf;

Answer: 650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/86/82/wKioL1fBdpDyGpCRAACAi1hADIw305.jpg "title=" 1. JPG "alt=" wkiol1fbdpdygpcraacai1hadiw305.jpg "/>

11, the display/etc/rc.d/rc.sysinit file with the beginning of #, followed by at least one white space character, and then have at least one non-whitespace character line;

Answer: 650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/86/83/wKioL1fBq6GgBLkvAAgq_CeaV0E389.jpg "title=" 1. JPG "alt=" wkiol1fbq6ggblkvaagq_ceav0e389.jpg "/>


12, the Netstat-tan command execution results in the "LISTEN", followed by or with a blank character end of the line;

Answer: 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/86/82/wKiom1fBeTLStyXDAABFs42MOE4157.jpg "title=" 1. JPG "alt=" wkiom1fbetlstyxdaabfs42moe4157.jpg "/>

13, add user bash, Testbash, basher, Nologin (this one user's shell is/sbin/nologin), and then find the current system on its user name and the default shell of the same user information;

Answer: 650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/86/83/wKiom1fBqk_DHbbeAAL-ltiKwsQ680.jpg "title=" 1. JPG "alt=" wkiom1fbqk_dhbbeaal-ltikwsq680.jpg "/>



This article from "Time book" blog, declined reprint!

Marco 2016 new Linux+python high-end Operation fourth week

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.