Linux pre-stage classroom Test 2

Source: Internet
Author: User
Tags cpu usage ssh server rsyslog chrony

1. The modification time is 2016-11-01 12:06:26;

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/8E/wKiom1mBzeWDxKtrAAAgSxeYaqI719.png "title=" Screenshot from 2017-08-02 21-02-24.png "alt=" Wkiom1mbzewdxktraaagsxeyaqi719.png "/>


2. After the successful modification, according to the format of%y-%m-%d output, and save the output of one copy to/mnt/date.txt;

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9D/8E/wKioL1mBzmSR_JsHAAAgSxeYaqI659.png "title=" Screenshot from 2017-08-02 21-02-24.png "alt=" Wkiol1mbzmsr_jshaaagsxeyaqi659.png "/>


3. Review the date 80 days ago, redirect to file/mnt/datafile, and then view the date 80 days later,
Append to file/mnt/datafile;

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/8E/wKiom1mBzt-AfhTgAAAgSxeYaqI402.png "title=" Screenshot from 2017-08-02 21-02-24.png "alt=" Wkiom1mbzt-afhtgaaagsxeyaqi402.png "/>


4. Use a command to view the number of bytes, characters, lines, and words of the/mnt/datafile file;

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/8E/wKioL1mBz5ywVyMtAAAgSxeYaqI157.png "title=" Screenshot from 2017-08-02 21-02-24.png "alt=" Wkiol1mbz5ywvymtaaagsxeyaqi157.png "/>


5. Execute the most recent command with the "date" keyword via a shortcut;

Ctrl+r

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/8E/wKioL1mBz_KxNxbpAAAgSxeYaqI650.png "title=" Screenshot from 2017-08-02 21-02-24.png "alt=" Wkiol1mbz_kxnxbpaaagsxeyaqi650.png "/>


6. Use a command to create a file in the/mnt directory westosx_filey,x the range of values for {a,b,c},y is 8-13;

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/8E/wKioL1mB0IHjkaJIAAAgSxeYaqI397.png "title=" Screenshot from 2017-08-02 21-02-24.png "alt=" Wkiol1mb0ihjkajiaaagsxeyaqi397.png "/>


7. Move the Westosx_filey files to the/tmp directory;

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/8E/wKioL1mB0OjTDw1wAAAgSxeYaqI281.png "title=" Screenshot from 2017-08-02 21-02-24.png "alt=" Wkiol1mb0ojtdw1waaagsxeyaqi281.png "/>


8. Copy/etc/group files to/mnt;

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9D/8E/wKioL1mB0ivD0IVeAAATESc2oLo162.png "title=" Screenshot from 2017-08-02 21-21-36.png "alt=" Wkiol1mb0ivd0iveaaatesc2olo162.png "/>

-Vim Edit the file, copy the first three lines, Paste to line 5th

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/8E/wKioL1mB0sjiyZGpAAA9S2AT8Rs394.png "title=" Screenshot from 2017-08-02 21-25-01.png "alt=" Wkiol1mb0sjiyzgpaaa9s2at8rs394.png "/>

-Clip Line 5th, paste to the last line;

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/8E/wKiom1mB0x7hcg-HAABNa3ro20Q823.png "title=" Screenshot from 2017-08-02 21-26-36.png "alt=" Wkiom1mb0x7hcg-haabna3ro20q823.png "/>

-delete the third line to the bottom;

DD 64 Line
-add root words at the beginning of 3-10 rows;

Ctal+v I ESC

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/8F/wKiom1mB1C3wdu-fAAA1IqUzres670.png "title=" Screenshot from 2017-08-02 21-31-04.png "alt=" Wkiom1mb1c3wdu-faaa1iquzres670.png "/>

-Replace the root in 5-10 rows with a kiosk in the left and right split-screen case;

Ctrl+w v:5,10s/root/kiosk/g

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/8F/wKioL1mB1J6SIFZ0AACoksE64AE820.png "title=" Screenshot from 2017-08-02 21-33-02.png "alt=" Wkiol1mb1j6sifz0aacokse64ae820.png "/>-exit left and right split screen, Replace the kiosk in the full text in the case of the top and bottom split screen as student;

Ctrl+w s

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/8F/wKiom1mB1P6xhBvFAAD39WruAls317.png "title=" Screenshot from 2017-08-02 21-34-37.png "alt=" Wkiom1mb1p6xhbvfaad39wruals317.png "/>


9. Configure VIM to have the following functions when editing a file: Display line number, mouse can manipulate cursor position;

Vim/etc/vimrc

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9D/8F/wKioL1mB1Yrj3WKFAABqMy64-uw457.png "title=" Screenshot from 2017-08-02 21-36-53.png "alt=" Wkiol1mb1yrj3wkfaabqmy64-uw457.png "/>


10. User and User group operations
-Create User group phone, specify the GID is 888, the following new users belong to the phone user group;
-Create user mi, set Uid=1800,shell type to/bin/sh;
-Create user iphone, set uid=1801, user described as "subscriber iphone";
-Create user Huawei, set user description as "Huawei", user home directory for/huawei;

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9D/8F/wKioL1mB2r6SkPFBAADD-BsG8L4934.png "title=" Screenshot from 2017-08-02 21-58-29.png "alt=" Wkiol1mb2r6skpfbaadd-bsg8l4934.png "/>


* * For business needs, do the following:
-Modify the UID of the user mi to 1700,shell different type for/sbin/nologin;
-Modify User's iphone description as "Apple phone";
-Modify user's home directory for Huawei/home/huawei;

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9D/8F/wKioL1mB23KCMMexAABUkwjPAf0484.png "title=" Screenshot from 2017-08-02 22-02-07.png "alt=" Wkiol1mb23kcmmexaabukwjpaf0484.png "/>


11. (password management) an administrator establishes a user admin for managing accounts that meets the following criteria:
-uid=7777,gid=7777, user described as "system administrator";

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/90/wKiom1mB2-6wjbvcAAAvwzZbGv0775.png "title=" Screenshot from 2017-08-02 22-04-17.png "alt=" Wkiom1mb2-6wjbvcaaavwzzbgv0775.png "/>


-New user group BANK1,BANK2, so that the newly created user group is an additional group of admin users;

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9D/8F/wKioL1mB3D2Q7s-uAABQI29Pxxc047.png "title=" Screenshot from 2017-08-02 22-05-35.png "alt=" Wkiol1mb3d2q7s-uaabqi29pxxc047.png "/>


-Set Admin user's password to "AdminPassword";

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/90/wKiom1mB3Hayx9dgAAA2Ef2PjeE420.png "title=" Screenshot from 2017-08-02 22-06-33.png "alt=" Wkiom1mb3hayx9dgaaa2ef2pjee420.png "/>


-Change the password to use the number of days to 0, so that the user must change the password for the first time;

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/90/wKiom1mB3LbxEmBgAAATAEZZ_mM219.png "title=" Screenshot from 2017-08-02 22-07-36.png "alt=" Wkiom1mb3lbxembgaaataezz_mm219.png "/>


-Change Password minimum validity is 7, so that the user set the password wait 7 days before the password can be changed again;

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9D/90/wKioL1mB3VHzkIcjAAASY3uYdpc258.png "title=" Screenshot from 2017-08-02 22-10-12.png "alt=" Wkiol1mb3vhzkicjaaasy3uydpc258.png "/>


-Delegating permissions to the Admin user so that the user can create a new user (no password method).

Visudo

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/90/wKioL1mB3frzvSLyAAA6kFu5poM264.png "title=" Screenshot from 2017-08-02 22-12-51.png "alt=" Wkiol1mb3frzvslyaaa6kfu5pom264.png "/>

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9D/90/wKiom1mB3qfikwyzAAAggwGE7lg989.png "title=" Screenshot from 2017-08-02 22-15-50.png "alt=" Wkiom1mb3qfikwyzaaaggwge7lg989.png "/>


12. Create a public directory/pubdir, so that all users can write to the directory, but only to delete their own files or directories;

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9D/90/wKioL1mB3vqC9r9OAAAmjMy4ufA029.png "title=" Screenshot from 2017-08-02 22-17-17.png "alt=" Wkiol1mb3vqc9r9oaaamjmy4ufa029.png "/>


13. Show CPU usage in the first five PID, and redirect to file/mnt/pidfile;

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/90/wKioL1mB34fR5qASAAAjQ-uGWWE736.png "title=" Screenshot from 2017-08-02 22-19-30.png "alt=" Wkiol1mb34fr5qasaaajq-ugwwe736.png "/>


14. Display the user who tried to log in to your host but not logged in successfully, save to/mnt/login_fail.txt file;

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/90/wKioL1mB4BXyaKTTAAAW0Nnb-QU767.png "title=" Screenshot from 2017-08-02 22-21-58.png "alt=" Wkiol1mb4bxyakttaaaw0nnb-qu767.png "/>


15. Set the SSH server side, do not allow remote connection through password authentication;

Vim/etc/ssh/sshd_config

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9D/90/wKiom1mB4Hmy1-YNAADBiXXDwHo574.png "title=" Screenshot from 2017-08-02 22-23-40.png "alt=" Wkiom1mb4hmy1-ynaadbixxdwho574.png "/>

Systemctl Restart Sshd.service


16. Packaging compression/mnt file for the tar.gz format, the implementation of no password (that is, through the key authentication) to send the compression package to the real Machine kiosk user's desktop;

Practice using Virtual machine server instead of a real machine kiosk as an example

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/90/wKioL1mB4WrRP7w4AABEOa4leQw664.png "title=" Screenshot from 2017-08-02 22-27-37.png "alt=" Wkiol1mb4wrrp7w4aabeoa4leqw664.png "/>

Server

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/90/wKioL1mB403wbd0AAAA4KdvIA8Y417.png "title=" Screenshot from 2017-08-02 22-35-44.png "alt=" Wkiol1mb403wbd0aaaa4kdvia8y417.png "/>

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/90/wKiom1mB42Cg-f_5AAAcWLBlZik123.png "title=" Screenshot from 2017-08-02 22-36-04.png "alt=" Wkiom1mb42cg-f_5aaacwlblzik123.png "/>

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/90/wKioL1mB45ORGrk3AAAbD5r82d4714.png "title=" Screenshot from 2017-08-02 22-36-29.png "alt=" Wkiol1mb45orgrk3aaabd5r82d4714.png "/>


Result: no password verification transfer succeeded

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/90/wKiom1mB4-XjlQGrAACZLF9OQaU421.png "title=" Screenshot from 2017-08-02 22-38-00.png "alt=" Wkiom1mb4-xjlqgraaczlf9oqau421.png "/>


17. Realize the time synchronization between your host and 172.25.254.250 host;

Server-side

Vim/etc/chrony.conf

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/90/wKiom1mB5QazT60KAABM_zFg8pM456.png "title=" Screenshot from 2017-08-02 22-42-45.png "alt=" Wkiom1mb5qazt60kaabm_zfg8pm456.png "/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/90/wKioL1mB5Q6B2196AABnp5piyAc985.png "title=" Screenshot from 2017-08-02 22-41-21.png "alt=" Wkiol1mb5q6b2196aabnp5piyac985.png "/>

Systemctl Restart Chronyd.service


Client

Vim/etc/chrony.conf

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/91/wKiom1mB5Y6DqvfPAABEo7ozpEk832.png "title=" Screenshot from 2017-08-02 22-45-17.png "alt=" Wkiom1mb5y6dqvfpaabeo7ozpek832.png "/>

Systemctl Restart Chronyd.service


650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/91/wKioL1mB5vmQrabRAAC6TGA1WlE784.png "title=" Screenshot from 2017-08-02 22-51-08.png "alt=" Wkiol1mb5vmqrabraac6tga1wle784.png "/>


18. Set your host's time zone to Africa/conakry;

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/91/wKiom1mB7RzBEVRBAAB7iv3Thas062.png "title=" Screenshot from 2017-08-02 23-17-32.png "alt=" Wkiom1mb7rzbevrbaab7iv3thas062.png "/>


19. Sync all the log information on your console to the real machine;

Practice using Virtual machine server instead of a real machine kiosk as an example

Host side

Vim/etc/rsyslog.conf

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/91/wKiom1mB7_6CfQVRAAAjgLU7ETs124.png "title=" Screenshot from 2017-08-02 23-29-30.png "alt=" Wkiom1mb7_6cfqvraaajglu7ets124.png "/>

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/91/wKiom1mB7lKDeshHAABOqXL3sUo296.png "title=" Screenshot from 2017-08-02 23-22-44.png "alt=" Wkiom1mb7lkdeshhaaboqxl3suo296.png "/>

Server Side

Vim/etc/rsyslog.conf

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/91/wKioL1mB7o_h14N_AAApa5GJ07A959.png "title=" Screenshot from 2017-08-02 23-23-42.png "alt=" Wkiol1mb7o_h14n_aaapa5gj07a959.png "/>


20. Set your real IP to 172.25.254.x via the NMCLI command (x is your real machine IP plus 100), the gateway is 172.25.254.250;
21. Set up your host DHCP acquisition IP through the management profile;
22. Build local yum Repository, use Yum to install LFTP and vsftpd software, uninstall VSFTPD software after installation.



Linux pre-stage classroom Test 2

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.