CentOS installed, the necessary environment variable settings

Source: Internet
Author: User

After installation CentOS need to manually configure the necessary environment variables, otherwise it is inconvenient to use. The following is a new installation of CentOS problems, to solve.


One, ordinary users can not use a lot of commands

The Echo $PATH is executed separately under the normal user and root user, and four addresses are missing from the average user's PATH:/sbin:/usr/sbin:/usr/local/sbin:/usr/kerberos/sbin and Ifconfig just in Sbin inside. Modify the/home/user/.bash_profile to add/sbin:/usr/sbin:/usr/local/sbin:/usr/kerberos/sbin these paths after path.

namely path= $PATH: $HOME/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/kerberos/sbin

Source/home/xxx/.bash_profile can then be executed at the terminal


Two, root user many commands also cannot execute

Execute command under root user echo $PATH, generally less/sbin,/usr/sbin,/usr/local/sbin. Causes the Visudo command to be used to add permissions for ordinary users to use the sudo command. Modify the Global environment variable. Add the export path= $PATH at the end of/etc/profile:/sbin:/usr/sbin:usr/local/sbin. Then enter source/etc/profile on the terminal.

The root user can then basically execute all commands.


Third, ordinary users add sudo permissions

In the case where two has been completed, enter at the terminal:

#visudo

The command is the edit/etc/sudoers file.

In the line root all= (all), add the following:

Usrname all= (All)

Then save the exit. The normal user can use the sudo command.

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.