Hi again,

When we create a new user, we face problem with using ‘sudo’ with the new account..

After big research, I found solution to my problem….I followed these steps…

1) Earlier I found these errors

lfs@boss:/media/LFS$ mkdir audhil

mkdir: cannot create directory `audhil’: Permission denied

lfs@boss:/media/LFS$ sudo mkdir audhil

[sudo] password for lfs: 

Sorry, try again.

[sudo] password for lfs: 

lfs is not in the sudoers file.  This incident will be reported.   <– I got this after entering my correct password of user lfs

2) After, adding a line

%lfs ALL=(ALL)NOPASSWD: ALL

at bottom of /etc/sudoers file
It works pretty good,

To break it down:

  • %lfs – lfs group
  • ALL= all users of lfs group
  • (ALL) – can run as any user
  • NOPASSWD – provides access without prompting for your password.
  • ALL – full access to all privileged commands

You can open /etc/sudoers file using any of your favorite text editor, in my case I used VIM..you can have your own..

lfs@boss:/media/LFS$ mkdir audhil

mkdir: cannot create directory `audhil’: Permission denied

lfs@boss:/media/LFS$ sudo mkdir audhil
lfs@boss:/media/LFS$ ls

audhil    lost+found  sources  tools

lfs@boss:/media/LFS$ rm audhil -R

rm: remove write-protected directory `audhil’? y
rm: cannot remove `audhil’: Permission denied

lfs@boss:/media/LFS$ sudo rm audhil -R

Enjoy…..!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s