Linux common commands (CentOS)

Source: Internet
Author: User
Tags nameserver

Operating system-related

Immediate shutdown: shutdown-h now

User-related

Delete User Userdel Liuyanfei

Add User Useradd Liuyanfei

Set new user password passwd Liuyanfei

File/folder Related
    1. LS lists all files or folders under the current folder
    2. chmod modifying file or folder permissions
Enables normal users to execute commands with root privileges

After the root user logs in, edit the/etc/sudoers file, locate the following line, and add a row under root, as shown below:

# allow ROOT to run any commands anywhere

Root all= (All) all

Liuyanfei all= (All) all

After the modification, can now log in with Liuyanfei account, and then use the command Su-, you can get root permissions to operate

Set Network IP Address:
    1. Modify IP Address file/etc/sysconfig/network-scripts/ifcfg-eth0

      Device=eth0

      Bootproto=static

      broadcast=192.168.197.255

      hwaddr=00:0c:29:22:b0:7e

      ipaddr=192.168.197.100

      Ipv6init=no

      Ipv6_autoconf=no

      netmask=255.255.255.0

      network=192.168.197.1

      Nm_controlled=no #不受Network Manager control

      Onboot=yes

    2. Modify Modify gateway address file/etc/sysconfig/network

      Networking=yes

      Hostname=centos1

      gateway=192.168.197.1

    3. Modify the DNS file/etc/resolv.conf

      NameServer 8.8.8.8 #google域名服务器

      NameServer 114.144.114.114 #国内域名服务器

    4. Restart the NIC

      # Service Network Restart

Linux common commands (CentOS)

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.