Newbie

Sigma721

Well-Known Member
Joined
Sep 14, 2011
Messages
122
Reaction score
0
Hi everyone

I am completely new to Linux. I am running Centos, because the radius server I use needs to run on it.

I am trying to edit a txt file in var/www folder i think it is the apache folder. But i get a "permission denied" error every time i try and edit the txt file.

Why is this?
 
IF Centos uses Nautilus then try this:

Open a terminal
Type: sudo nautilus
This will open your file browser, navigate to file make changes and save.

You need super user permission to change that file.
 
Thanks alot.

The terminal gives me the error - "admin is not in the Sudoers list, his will be reported". The only user account i have is the "admin" one.
What should I change?
 
Add user to sudoers file

Well, CentOS initially only has one user setup for sudo initially - that would be root. So you would essentially need to add yourself to the sudoers file before being able to use sudo as yourself. For that, you will need the root password, which you should have somewhere if you setup the server yourself. Otherwise, speak to whoever owns/administrates the server.

So open a terminal.
Type in the following:

Code:
su -

You'll need to provide the root password when prompted.

Now, as root, type in the following:

Code:
visudo

This will open the sudoers file

Scroll down using the down arrow key, and find the line that looks like:
root ALL=(ALL) ALL

move the cursor to the line just underneath this, and press the 'I' key on your keyboard. At the bottom of the terminal window you should see "--INSERT--" appear.

Now press the Enter key on your keyboard to create a new line. In that new-line space, type the following:

Code:
admin    ALL=(ALL)       ALL

Note that I've put 'admin' in here, as you said that your username is admin. If not, change the 'admin' word in this line to whatever your username is.

When done, press the 'Esc' key on your keyboard (the "--INSERT--"" line at the bottom of the terminal window should now disappear), and then type in the following:

Code:
:wq

And that should be about it. Now type in
exit
to return to your user session, and then attempt to use the previous posted commands.

Note that the change to the sudoers file will remain until it is edited again.
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X