Difference between revisions of "Setting up sudo"

From gr0x0rd
Jump to navigation Jump to search
(Created page with "Next, we will emerge sudo, which will allow you to do things as a super user from your own account. Next, we will emerge sudo, # which will allow you to do things as a super u…")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Next, we will emerge sudo, which will allow you to do things as a super user from your own account.
+
Next, we will emerge sudo, which will allow you to do things as a super user from your own account. Think of it as a simple prefix that makes you god, but only when you need to be. Here's a great [http://xkcd.com/149/ example].
  
  Next, we will emerge sudo,
+
  '''#''' emerge -av app-admin/sudo
# which will allow you to do things as a super user from your own account.
 
  
emerge -av app-admin/sudo
+
Now we'll need to add your account to the list of sudoers.
  
# Once sudo is installed, you may have to run
+
'''#''' nano -w /etc/sudoers
  
etc-update
+
=== /etc/sudoers ===
  
# Now we'll need to add your account to the list of sudoers.
+
Find the line that says
  
nano -w /etc/sudoers
+
root    ALL=(ALL) ALL
  
# Find the line that says
+
and just below add
 
 
root    ALL=(ALL) ALL
 
 
 
# and just below add
 
 
 
<your username> ALL=(ALL) ALL
 
 
 
# and use ctrl-x to exit then save the file. A note about sudo-
 
# you can run any command using sudo, so long as you enter "sudo"
 
# before the command. Sudo will then ask you for a password. Now
 
# that sudo is installed, log out of the root account.
 
 
 
logout
 
 
 
# now enter your new credentials to log into the system.
 
  
login: <username>
+
''username'' ALL=(ALL) ALL
password: <your password>
 
  
 +
As always, use ctrl-x to exit then save the file.
  
Once sudo is installed, you may have to run
 
  
etc-update
+
----
 +
'''Note:''' using sudo
  
Now we'll need to add your account to the list of sudoers.
+
You can run any command as root from your user account using sudo by simply typing ''sudo'' before the command. Sudo will then ask you for your password. From now on you'll never need to use your root account or password unless it's an emergency and you're dealing with security issues or hardware failure.
 
+
----
nano -w /etc/sudoers
 
 
 
Find the line that says
 
 
 
root    ALL=(ALL) ALL
 
 
 
and just below add
 
  
<your username> ALL=(ALL) ALL
 
  
and use ctrl-x to exit then save the file. A note about sudo-
+
Now that sudo is installed, log out of the root account.
you can run any command using sudo, so long as you enter "sudo"
 
before the command. Sudo will then ask you for a password. Now  
 
that sudo is installed, log out of the root account.
 
  
  logout
+
  '''#''' logout
  
now enter your new credentials to log into the system.
+
Now enter your new credentials to log into the system.
  
  login: <username>
+
  login: ''username''
  password: <your password>
+
  password: ''<your password>''
 +
'''$'''
 +
Nice work! You have a fully functional and secure Gentoo Linux system. But chances are you are going to require a graphical user interface of some sort. Let's move on to [[Configure X]].

Latest revision as of 20:05, 3 December 2010

Next, we will emerge sudo, which will allow you to do things as a super user from your own account. Think of it as a simple prefix that makes you god, but only when you need to be. Here's a great example.

# emerge -av app-admin/sudo

Now we'll need to add your account to the list of sudoers.

# nano -w /etc/sudoers

/etc/sudoers

Find the line that says

root    ALL=(ALL) ALL

and just below add

username	ALL=(ALL) ALL

As always, use ctrl-x to exit then save the file.



Note: using sudo

You can run any command as root from your user account using sudo by simply typing sudo before the command. Sudo will then ask you for your password. From now on you'll never need to use your root account or password unless it's an emergency and you're dealing with security issues or hardware failure.



Now that sudo is installed, log out of the root account.

# logout

Now enter your new credentials to log into the system.

login: username
password: <your password>
$ 

Nice work! You have a fully functional and secure Gentoo Linux system. But chances are you are going to require a graphical user interface of some sort. Let's move on to Configure X.