Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

I've locked myself out of my Ubuntu box!

  • 11-07-2007 05:22PM
    #1
    Closed Accounts Posts: 17,208 ✭✭✭✭


    From the "Its important to double check the documentation" department:

    I've been having a bit of fun resetting up my file server at home. But today I managed to pull the right doozie of them all, and I can't find a way around it.

    I have been trying to implement an init.d script I found to control Subversion. I made a few small modifications to the script so that I could run them from my own user account (dumb, I now know). Anyway, part of that meant adding my account to a new user group "subversion".

    usermod -Gsubversion aidan

    Now its time to do some editing. sudo emacs /blah/blah/etc

    "aidan is not in the sudoers file. This incident will be reported."

    Well, what I discover now is that, slightly contrary to what the original webpage had told me about -G (adds the user to a new group), it also erases the groups that the user is currently added to (for reasons that are beyond me at the minute...). And now I can't sudo to add a new user to sort the problem out?

    Anyone got any suggestions?


Comments

  • Registered Users, Registered Users 2 Posts: 1,569 ✭✭✭maxheadroom


    Boot off a live CD. Open a root terminal. Chroot into your ubuntu server. Edit the /etc/group or /etc/sudoers file


  • Registered Users, Registered Users 2 Posts: 2,372 ✭✭✭Illkillya


    If you don't have a live CD, you can also get access by booting into single user mode (Google it)


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    No, I have a LiveCD here. Cheers guys.


  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    Boot off a live CD. Open a root terminal. Chroot into your ubuntu server. Edit the /etc/group or /etc/sudoers file

    That should do it. If you don't know how to chroot your ubuntu install from the live cd just ask here. :)


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    scojones wrote:
    That should do it. If you don't know how to chroot your ubuntu install from the live cd just ask here. :)
    Or in the Moderator forum ;)


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,221 ✭✭✭Explosive_Cornflake


    Fyi, the switch you want usermod -aG, to add yourself to a supplemental group.
    Suse use just G afiak, and gentoo is -aG. I got caught out by that before, but luckily i had a another shell open as root.


  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    Or in the Moderator forum ;)

    I have to say that was gas. hehe. :)


  • Registered Users, Registered Users 2 Posts: 6,946 ✭✭✭SouperComputer


    always keep a copy of RIP handy!


Advertisement