Linux Network configuration

Source: Internet
Author: User
Tags asymmetric encryption

1. What is the command to get an IP address automatically? Do you know under what circumstances your Linux can automatically obtain an IP address?
Use the command dhclient to obtain an IP address automatically, only if our Linux network has a DHCP server to automatically get the IP,DHCP service is a distribution IP manager.

2. Remotely connect a Linux server and require the Linux server to turn on the sshd service, which port does the SSHD service listen to by default? Can this port be customized? If so, how can I customize it?
The SSHD service listens to port 22 by default, this port is customizable, needs to modify the/etc/ssh/sshd_config configuration file, modify "#Port 22" to "Port 12553" where 12553 is the newly defined sshd port.

3. What are the common terminal tools for remote connection Linux?
Putty, secure CRT, secure SSh, Xshell, etc.

4. Manually configure the IP, which configuration file needs to be modified? Change the default configuration file, which areas need to be changed, which lines need to be added?
Configuration file needs to be modified/etc/sysconfig/network-scripts/ifcfg-eth0
What you need to modify are:
Change: bootproto=static
Added: ipaddr=192.168.0.11
Added: netmask=255.255.255.0
Added: gateway=192.168.0.1
Added: dns1=192.168.0.1


5. What is the command to restart the network service?
Service Network restart or
/etc/init.d/network restart

6. Which configuration file do I need to modify to configure DNS?
Configure DNS to modify the configuration file is/etc/resolv.conf, but if we install a tool called network Manager, then the configuration of this file is not possible, because it will be based on/etc/sysconfig/network-scripts/ Ifcfg-eth0 this inside the settings to automatically get the DNS address, so, we recommend that you configure the DNS address in the future, directly in the network card configuration file/etc/sysconfig/network-scripts/ifcfg-eth0 to set up, add the following:
dns1=192.168.0.1
dns2=192.168.0.2

7. Please check the information on how the decryption key pair works. (The answer is to use the East tree classmate)
Key pairs are cryptographic algorithms that are public-key cryptography (or asymmetric encryption), such as RSA and DSA, which use a pair of keys, the public key and the private key. Among them, the public key can be randomly distributed, only for encryption, the private key is only owned by one person, only for decryption. Any information that is encrypted with the public key can be decrypted with the private key to obtain the original information.
The RSA key pair works as follows:
Assuming that two users, A and B, are communicating, both a and a are given a pair of public and private keys for encryption and decryption, and the public and private keys for a publica and privatea,b are PUBLICB and Privateb respectively.
(1) A and B to send information to each other, so to exchange the public key, A's public key tells B,b's public key to tell a. But the private key is confidential, just own it.
(2) A sends a message to B, and the plaintext is X.
A use the public key of B to encrypt the plaintext X to form a ciphertext PUBLICB (x), and then transfer the ciphertext to B;
B received ciphertext, with the private key of B to decrypt the cipher Privateb (c (x)), to get the plaintext X to communicate.
(3) B sends a message to a, and the plaintext is Y.
b using the public key of a to encrypt plaintext Y to form ciphertext publica (y), and then transfer ciphertext to A;
A The cipher text is received, the ciphertext is decrypted with the private key of a Privatea (c (x)), and the plaintext Y to be communicated is obtained.

8. Use Putty's generate key pair tool to generate a public and private key, and set the private key password, copy the public key to Linux, and implement a key to log on to your Linux. Note that the two key points are to set the. SSH directory permissions and to turn off SELinux.
Putty generated public key copied and pasted into the Linux/root/.ssh/authorized_keys file, the default/root/.ssh this directory does not exist, we need to manually create: Mkdir/root/.ssh and modify the permissions for 700:chmod 700/root/.ssh; there are two ways to turn off SELinux: (1) permanently close, edit/etc/selinux/config change selinux=enforcing to selinux= Disabled then restart Linux (2) temporarily shut down Selinux:setenforce 0

9. How can I temporarily close selinux? How do I permanently turn off selinux?
Temporary shutdown Selinux:setenforce 0
Permanently shut down, edit/etc/selinux/config change selinux=enforcing to selinux=disabled and restart Linux

10. How do I temporarily configure my host name? And how do you get it to restart and still take effect?
If you want to change the hostname to "aming.com", you need to do this
Hostname aming.com
To take effect after reboot, you need to modify the configuration file/etc/sysconfig/network to hostname=aming.com

11. What is the command to view Linux with several NICs and network card IP?
Ifconfig-a

Under CentOS, you can use the Setup command to configure IP for the network card, and if not, how do I install the command?
Yum install-y Setuptool System-config-network-tui

13. Check to see if a network card is connected to the network cable command?
Mii-tool eth0

14. What is the command to view the system time? How do I change the system time?
Date
Date-s "2013-09-01 10:00:00"
Another way is to synchronize time on the time server: first install NTP yum install-y NTP, after installation, use the command ntpdate time.windows.com to

15. How do I adjust the font and size of the putty display? How do I change the character set of the putty so that it supports Chinese display?
Adjust the font method for the Putty display: from the left directory to the Window-appearance page, click the Change button in the font settings (font settings) to select the appropriate font and size.
To change the way the Putty character set supports Chinese: Enter the Window-translation page from the left directory and select UTF-8 font in the remote character set column.

Linux Network configuration

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.