Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

For some reason I cannot access my root user via SSH. It displays the error on login:

could not open session.

However I happen to have another user account that is a normal non-sudo user. Is there any way I can run a su root command or anything to make this user with sudo privilege?

I have the password of the root user.

share|improve this question
    
Did you try running su? –  Khaled Feb 16 '13 at 10:31
    
Yes I did. su root and it's the same message: could not open session". I was thinking maybe the sudo command has some kind of an option to specify the username and a password in order not to use the DEFAULT logged in username.. –  Alex Feb 16 '13 at 10:33
    
What changes did you make immediately prior to this happening ? –  Iain Feb 16 '13 at 10:53
    
I added some changes in the limits.conf file set the soft and hard limit for user root to unlimited. –  Alex Feb 16 '13 at 11:00

2 Answers 2

up vote 2 down vote accepted

If you messed up your limits such that they prevent you from logging in, you'll need to reboot the machine into maintenance mode. Depending on exactly what sort of problem you created, adding single to your boot options (in grub, hit "e" to edit the kernel line, add single to the end, hit esc to exit, then press "b" to boot) will often be enough to give you a shell. If you messed things up in a slightly different way, try adding init=/bin/bash to the end, instead. In either event, that should give you enough access to resolve the issue.

If none of that works or in the worst case, you can always fire up a LiveCD and mount the affected drive in order to undo the changes you made.

share|improve this answer
    
The problem is I don`t have a "phisical" access to the Host. It's ordered from a hosting company. I only have ssh access to it :( –  Alex Feb 16 '13 at 11:38
1  
Speaking as someone who works for a hosting company: if you ask Support to give you a hand with this, I 100% guarantee they have a process in place for adding these sorts of parameters to the boot process. And if you ask very nicely and describe what you did very well, they'll likely be able to very quickly solve your limit issue. There's even a small chance they can do it without rebooting the machine. –  BMDan Feb 16 '13 at 12:18
    
Thank you for your answer. I would submit a ticket and nicely ask them to fix my stupid mistake. –  Alex Feb 16 '13 at 12:31

Anyone (who knows the password...) can use su to switch to root (as opposed to sudo).

share|improve this answer
    
as stated before, it gives me an error: " could not open session" due to an increase of the ulimit I did. –  Alex Feb 16 '13 at 10:34
    
so basically you screwed yourself over :P? –  Lucas Kauffman Feb 16 '13 at 10:37
    
Pretty much.. Anything I could possibly do to revert the cahnges or anything? I have criticall datas on this host. –  Alex Feb 16 '13 at 10:38
    
Restore your backups? –  Lucas Kauffman Feb 16 '13 at 10:50
    
I have none.. well I might be able to save the datas somehow but it's a LAST ULTIMATE RESORT. .. –  Alex Feb 16 '13 at 11:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.