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:


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

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.