View Full Version : [ubuntu] Logging in as root??
pavsid
October 27th, 2009, 08:08 PM
Hi, i hope someone can help.
I have an Ubuntu Server which i administer via SSH and tonight i stupidly moved myself to another group without keeping the previous group. As a result i can't run any sudo commands as all i get is "pav is not in the sudoers file. This incident will be reported."
Is there anyway to log in as root so that i can add myself back into the necessary group???
sailthesea
October 27th, 2009, 08:16 PM
These forums forbid discussing this topic , but if you perhaps try elsewhere you will find out (I think I can tell you that)
Take GREAT care if you use commands in /root
bribera
October 27th, 2009, 08:29 PM
These forums forbid discussing this topic
Really? Is that just an unstated-but-still-enforced policy, or I am I missing something when I read the Code of Conduct (http://ubuntuforums.org/index.php?page=policy)?
sailthesea
October 27th, 2009, 08:45 PM
Really? Is that just an unstated-but-still-enforced policy, or I am I missing something when I read the Code of Conduct (http://ubuntuforums.org/index.php?page=policy)?
Pretty much an unwritten rule
With good reason too;)
bribera
October 27th, 2009, 08:57 PM
I might agree that the rule is good, but not writing it down simply sets people up to fail. :(
sailthesea
October 27th, 2009, 09:10 PM
I might agree that the rule is good, but not writing it down simply sets people up to fail. :(
True
But writing it down simply sets up people to ask "why?" and try to bend the rules.
Good point though:D
cariboo907
October 28th, 2009, 03:25 AM
Actually the guidelines aren't in the Code of Conduct (http://ubuntuforums.org/index.php?page=policy), but the are located in a stickie (http:///ubuntuforums.org/showthread.php?t=716201) at the top of this forum.
There is nothing that says that you can't tell someone how to enable the root account, as long as you explain the dangers of running as root.
I don't think it will help the op in this case as he is administering his server using ssh, sudo won't work in this case. The only way I can see him being able to repair the problem is by physically accessing the server.
lisati
October 28th, 2009, 03:30 AM
Have a look here: https://help.ubuntu.com/community/RootSudo
cariboo907
October 28th, 2009, 03:39 AM
lisati beat me to it with his link, but I haven't found any reason to enable the root account that I can't do using sudo -i
pavsid
October 28th, 2009, 04:53 AM
I don't think it will help the op in this case as he is administering his server using ssh, sudo won't work in this case. The only way I can see him being able to repair the problem is by physically accessing the server.
Woah, sorry to have caused such a stir!
i was hoping there was another way other than physically accessing the server - i presume if i have to go down this route then i'd boot into recovery mode and edit the sudoers file?
Thanks lisati for the link, but i can't issue any sudo commands as i'm accessing via ssh! Doh!
If i was to ask the same question on 'another forum' do you think i'll get an easyish way to do it without having to physically access the server, or is it near impossible given my situation?
thanks
QLee
October 28th, 2009, 07:51 AM
I have an Ubuntu Server which i administer via SSH and tonight i stupidly moved myself to another group without keeping the previous group.
What exact code did you use to do that?
piankhi
October 28th, 2009, 08:01 AM
What exact code did you use to do that?
good question :D
wojox
October 28th, 2009, 08:01 AM
Woah, sorry to have caused such a stir!
i was hoping there was another way other than physically accessing the server - i presume if i have to go down this route then i'd boot into recovery mode and edit the sudoers file?
Thanks lisati for the link, but i can't issue any sudo commands as i'm accessing via ssh! Doh!
If i was to ask the same question on 'another forum' do you think i'll get an easyish way to do it without having to physically access the server, or is it near impossible given my situation?
thanks
Doesn't matter what forum you go to they will all say the same thing: http://www.psychocats.net/ubuntu/fixsudo
pavsid
October 28th, 2009, 08:10 AM
What exact code did you use to do that?
i used...
sudo usermod -G group1,group2 pav
where my original group was neither group1 nor group2
Thing is though, i seem to remember still being able to run sudo commands until i rebooted - but can't be sure...
pavsid
October 28th, 2009, 08:13 AM
Doesn't matter what forum you go to they will all say the same thing: http://www.psychocats.net/ubuntu/fixsudo
Thanks for the link wojox, just what i needed...
CharlesA
October 28th, 2009, 09:45 AM
i used...
sudo usermod -G group1,group2 pav
where my original group was neither group1 nor group2
Thing is though, i seem to remember still being able to run sudo commands until i rebooted - but can't be sure...
Yeah, I did that a while ago too, totally locked myself out, but at least I had physical access to the machine. Recovery mode is very handy.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.