RSS

Category Archives: Linux

How to grant a user account access to sudo on CentOS

By default, new user accounts do not have access to use sudo command on a CentOS system. You have to manually add the users or their user group to the ‘/etc/sudoers file’. I do this as follows:

  1. nano -w /etc/sudoers
  2. Scroll down to the section ## Allow root to run any commands anywhere
  3. Below the root entry line I enter: blogchampion ALL=(ALL) ALL
  4. Save

User ‘blogchampion’ now has access to use the sudo command.

You can also add all users within a particular user group to have sudo permissions. I do this as follows:

  1. nano -w /etc/sudoers
  2. Scroll down to the section ## Allows people in group wheel to run all commands
  3. Below the %wheel entry line I enter: %bloguser ALL=(ALL) ALL

Now all users belonging to the bloguser user group have access to use the sudo command.

You probably also want to force users to use the root password when using sudo. See the post How to make CentOS ask for the root password with sudo for instructions.

 
Leave a comment

Posted by on March 19, 2013 in How to, Linux

 

Tags: , , ,

How to make CentOS ask for the root password with sudo

When you add a user to the ‘/etc/sudoers’ file, by default that account will be prompted for their user account password when using sudo. But it is far better to force the use of the separate root password for these requests. You can accomplish quite simply by adding a rule to the /etc/sudoers file.

  1. nano – w /etc/sudoers
  2. Scroll down to the section “# Defaults specification” and below that line enter: Defaults    rootpw
  3. Save the file.

Now when a user account tries to use the sudo command, they will be prompted for the root password.

 
Leave a comment

Posted by on March 19, 2013 in How to, Linux

 

Tags: , , ,

How to check the version of Ubuntu you are using

This one is quite complex and difficult. From the terminal, enter the following command:

lsb_release -a

Information returned to you:

Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise

Now breathe again.

 
Leave a comment

Posted by on August 3, 2012 in How to, Linux

 

Tags: , , , ,

How to upgrade Ubuntu Linux via the command line

Like almost everything in Linux, there’s a nice easy way to upgrade an existing Ubuntu installation to the latest version of the Operating System from a command line interface. And it can all be done in just a few simple steps. The most important of all, remembering to backup all that important data before even thinking of getting started with any upgrade – of course. Read the rest of this entry »

 
Leave a comment

Posted by on August 3, 2012 in How to, Linux

 

Tags: , , , ,

How to change the hostname in Ubuntu

I have often built a new desktop or server without giving much thought to the hostname I should use. I then become too lazy to ever change it later, leaving it set to something unhelpful or inappropriate for the purposes of deployment.

Thankfully it’s very easy to change your server hostname in Ubuntu, and across all other Linux distributions in general. It’s as simple as issuing a couple of commands via a command line interface, editing two files, and then a quick reboot to puts the changes into action. So there’s no real excuse not to right your previous wrong.

Let’s get started. Read the rest of this entry »

 
Leave a comment

Posted by on August 3, 2012 in How to, Linux

 

Tags: , , , ,

 
Follow

Get every new post delivered to your Inbox.