LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-16-2006, 12:02 PM   #1
gneeot
LQ Newbie
 
Registered: Jan 2006
Location: Ukraine
Distribution: Debian, Ubuntu, Fedora
Posts: 21

Rep: Reputation: 15
Please help. Sudo access problem


I've just removed my Ubuntu user from all groups and now I can't use sudo now.
It says: yura@yura:~$ sudo vi /etc/sudoers
yura is not in the sudoers file. This incident will be reported.

I need help ASAP cause I can't access my system.
Thanks in advance
 
Old 11-16-2006, 12:12 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Why did you remove your user from all groups? Doh!

Well, there's a couple things you can do. First I would reboot and select the option "Recovery Mode". If you don't have recovery mode, you'll have to boot with your Live CD and then chroot into your hard drive install.

Then from a command prompt, run visudo and add your user on a line like
Code:
yura ALL= ALL
. Save the file and exit. If you're in recovery mode, type init 2 and you should be presented with the graphical login. Then login and see if you have sudo access...

Also, note that the proper way to edit the sudoers file is to do sudo visudo as a user...
 
Old 11-16-2006, 03:18 PM   #3
Redeye2
Member
 
Registered: Feb 2004
Posts: 489

Rep: Reputation: Disabled
If you don't have an "Recovery Mode" entry, you can just add the kernel flag single to boot into single user mode and restore the necessary groups/permissions.
 
Old 11-16-2006, 03:21 PM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Quote:
Originally Posted by Redeye2
If you don't have an "Recovery Mode" entry, you can just add the kernel flag single to boot into single user mode and restore the necessary groups/permissions.
He'll need info as to how to enter Grub's edit mode and add that flag (since he has no root access). Sorry, but I'm not Grub expert and haven't fiddled much with grub at the command line.
 
Old 11-16-2006, 04:05 PM   #5
Redeye2
Member
 
Registered: Feb 2004
Posts: 489

Rep: Reputation: Disabled
When you're booting, select the entry that corresponds to Ubuntu and press E (for edit). Then go to the kernel line and again press E. At the end of the line add single and press Enter to accept the changes. Then press B to boot the system in single user mode.
 
Old 11-17-2006, 11:51 AM   #6
gneeot
LQ Newbie
 
Registered: Jan 2006
Location: Ukraine
Distribution: Debian, Ubuntu, Fedora
Posts: 21

Original Poster
Rep: Reputation: 15
Thank you guys for help. I just loaded Linux using recovery grub item and added "yura" to group "admin".

Regards,
Yuriy Padlyak
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
Blocking access on a particular app (via sudo) Harlin Linux - Security 10 10-22-2006 02:11 PM
secure root access with SUDO dussel Linux - Security 4 02-15-2006 08:26 AM
Give root access to user's display + sudo problems Ephracis Linux - General 12 01-11-2006 11:25 PM
Sudo access to particular directories angrybeaver Linux - Software 0 09-23-2004 01:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 06:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration