Initial Setup of a Linux CentOS5 / RHEL5 System

From CVL Wiki

(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
 
==='''''Never''''' login as root!===
 
==='''''Never''''' login as root!===
 
During the install, there will be a place to create an account.  Create an account there.  Login with the account you created during the install.
 
During the install, there will be a place to create an account.  Create an account there.  Login with the account you created during the install.
 +
 
===Get sudo working for your account.===
 
===Get sudo working for your account.===
 
Once you are logged in, start a "Terminal".  Type su, type the root password.  This will be the first and last time you type "su".  Now, edit /etc/sudoers.  Find the line
 
Once you are logged in, start a "Terminal".  Type su, type the root password.  This will be the first and last time you type "su".  Now, edit /etc/sudoers.  Find the line
Line 23: Line 24:
 
  jkh    ALL=(ALL) NOPASSWD:    ALL
 
  jkh    ALL=(ALL) NOPASSWD:    ALL
  
Since the /etc/sudoers is not "writeable" by anyone, to save the file you must use ":w!" followed by ":q"
+
Since the /etc/sudoers is not "writeable" by anyone, to save the file you must use ":w!" followed by ":q".  Now exit "su" with "Ctrl-D".
 +
 
 +
===Add the ''epel'' repository.

Revision as of 16:41, 17 March 2009

Setup of a Linux CentOS5 /RHEL5 System

After the initial install there are a number of things that I do to the system. I'm going to document them here.

Never login as root!

During the install, there will be a place to create an account. Create an account there. Login with the account you created during the install.

Get sudo working for your account.

Once you are logged in, start a "Terminal". Type su, type the root password. This will be the first and last time you type "su". Now, edit /etc/sudoers. Find the line

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL

and add you account:

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
jkh     ALL=(ALL) NOPASSWD:     ALL

I add the "NOPASSWD:" option, this allows you to run sudo with out typing your password. Many people would argue that this is a security problem. Just make sure that your password is strong.

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
jkh     ALL=(ALL) NOPASSWD:     ALL

Since the /etc/sudoers is not "writeable" by anyone, to save the file you must use ":w!" followed by ":q". Now exit "su" with "Ctrl-D".

===Add the epel repository.

Views
Personal tools
Support