Locked out of my server (Ubuntu 12.04.4 x32)
Locked out of my server (Ubuntu 12.04.4 x32)
Hi,
As a general security convention, it is common to create a user and add him to sudoers file with root priviledges and disable root login. That is what I did before setting up VestaCP.
The problem is; after I added my user to sudoers file with root privileges and disabled root login from sshd_config, vestacp overwrote the sudoers file without notification and removed my user from the sudoers file. Effectively disabling any sort of root access on my server (as far as I can understand).
Now I can log on to my server, but I cannot use sudo, and can't login as root. I have personal data I need to backup and I couldn't find a way to retrieve it.
I know VestaCP creates some users (I can do everything from the web interface) but I don't know how I can use it to regain root access (if it's possible at all).
Is there any way to solve this problem?
Thanks
Note: I followed a very common tutorial for the initial setup: https://www.digitalocean.com/community/ ... untu-12-04
I have these entries in my sshd_config:
As a general security convention, it is common to create a user and add him to sudoers file with root priviledges and disable root login. That is what I did before setting up VestaCP.
The problem is; after I added my user to sudoers file with root privileges and disabled root login from sshd_config, vestacp overwrote the sudoers file without notification and removed my user from the sudoers file. Effectively disabling any sort of root access on my server (as far as I can understand).
Now I can log on to my server, but I cannot use sudo, and can't login as root. I have personal data I need to backup and I couldn't find a way to retrieve it.
I know VestaCP creates some users (I can do everything from the web interface) but I don't know how I can use it to regain root access (if it's possible at all).
Is there any way to solve this problem?
Thanks
Note: I followed a very common tutorial for the initial setup: https://www.digitalocean.com/community/ ... untu-12-04
I have these entries in my sshd_config:
PermitRootLogin no
UseDNS no
AllowUsers <my-username>
Re: Locked out of my server (Ubuntu 12.04.4 x32)
Hi,
you can enable ssh access in the settings of your user
1.login to the vestacp
2.click the button "edit" for your user
3.find this setting SSH Access
4.select the sh
5.save settings
after this you can login to ssh on behalf of your user
user - name of your user in the vestacp
password - password of you user of vestacp
and you can restore root password
you can enable ssh access in the settings of your user
1.login to the vestacp
2.click the button "edit" for your user
3.find this setting SSH Access
4.select the sh
5.save settings
after this you can login to ssh on behalf of your user
user - name of your user in the vestacp
password - password of you user of vestacp
and you can restore root password
Code: Select all
su root
Re: Locked out of my server (Ubuntu 12.04.4 x32)
I applied the steps you mentioned. Since my user was added before installing VestaCP, it is not listed in the control panel. I tried creating it but I got an error saying it already exists. I tried creating a seperate user with shell access but I couldn't login with that either.
Re: Locked out of my server (Ubuntu 12.04.4 x32)
Give me admin access to vestacp
I want check this problem on your server
send me private message with password
I want check this problem on your server
send me private message with password
-
- Posts: 54
- Joined: Wed Dec 11, 2013 9:05 pm
Re: Locked out of my server (Ubuntu 12.04.4 x32)
Yea this is true, There should be a warning during setup at least to prompt you that its going to overwrite visudo. So you don't get locked out. But its always important to back up before you do any changes to your System especially if its a production server.