Linux Programming Learning notes (ii)

Source: Internet
Author: User

Last chapter, this chapter is the Linux remote login system operation Note

First, Linux is generally used as a server, but the server is in the room, it is not often run to the computer room to the operating system, so the use of remote login system, the Linux system is generally used in the SSH service is the default port number is 22, The Linux Telnet client on Windows has SECURECRT, PUtty, SSH scure Shell, and so on, this place mainly with PUtty to do a detailed explanation:

1, first download putty installation run the software. Enter the IP address of the server you want to log into in Host name (view the IP of the server via the ipconfig command), enter the login screen after the return, and ask for a login user name and password. Enter the root and enter the password again. Log on to the Linux remote server

2, the second method is the use of key authentication mechanism to log on to remote Linux

SSH is the abbreviation for Secure Shell, developed by the IETF Network Working group, which is a security protocol based on the application layer and the transport layer. Using the tool PUTTYEN.exe to generate a key pair, the tool can generate key in three formats, typically in the default format, and the number of bits in a generated key is the most common generated key. The larger the value, the more complex and secure the more. After setting the key to 2048 bits, click Generate to start generating the key pair.

Note here that in the process of generating the key pair, the mouse should be moved continuously, otherwise the progress bar will not change.

To this step, the key pair has been generated, you can enter a password for the secret key, enter in the key passphrase, you can not enter, click to save the public key and private key, note that the address to be kept secret. also prevents deletion. After that, you can set up a remote Linux host

To set up a login Linux host, proceed as follows:

(1) Create a directory/root/.ssh and set permissions

[[email protected] ~]# mkdir/root/.ssh mkdir command is used to create a directory.

[[email protected] ~]# chmod 700/root/.ssh chmod command is used to modify file attribute permissions.

(2) Create File/Root/.ssh/authorized_keys

[[email protected] ~]# vim/root/.ssh/authorized_keys vim command is a command to edit a text file

(3) Open the public key file that you just generated, we recommend using WordPad to open, so look comfortable, copy from the AAAA start to "----END SSH2 Public key----" All the contents of the line, paste into the/root/.ssh/authorized _keys file, make sure all words noon a line. (You can copy the copied content to Notepad, and then edit it into a line to download and paste into the file) when you open the file with vim, the file does not exist, so vim is created automatically. Press the letter "I" and then press SHIFT + Insert to paste (or right-click), as long as you have copied it to the Clipboard. After pasting, then move the cursor to the front of the line to enter Ssh-rsa , and then press space. Press ESC again, and then enter the colon Wq: Wq is saved.

(4) Set the Putty option, click on the left Ssh-->auth, click on the right of the browse, select the private key just generated, click Open at this time to enter the root and no longer enter the password login

Ii. Basic attributes of a file

Linux system is a multi-user system, different users in different positions using different permissions, Linux system to different users access to the same file (including directory) permissions set different rules.

Use the LS-L command to display the user groups and groups for a file property.

The first character in Linux represents the directory of this file, for example, the party when "D" refers to the directory;

"-" represents the document;

"/" means the linked document

"B" Device file inside the storage interface device (can be random access device)

"C" means a serial port device in the appliance file, such as a keyboard, mouse (one-time reading device) If no permission is indicated

Iii. changes to file attributes

1, Chgrp: Change the file group parameter-R means recursive change, the file group under the directory will change

Just remember this.

Linux Programming Learning notes (ii)

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.