Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion Debian/Ubuntu
  • Search

Locked out of my server (Ubuntu 12.04.4 x32)

Debian/Ubuntu related topics
Locked
  • Print view
Advanced search
5 posts • Page 1 of 1
kerem
Posts: 2
Joined: Tue Jul 15, 2014 10:24 pm

Locked out of my server (Ubuntu 12.04.4 x32)

Post by kerem » Tue Jul 15, 2014 10:41 pm

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:
PermitRootLogin no
UseDNS no
AllowUsers <my-username>
Top

imperio
VestaCP Team
Posts: 7000
Joined: Sat Dec 01, 2012 12:37 pm
Contact:
Contact imperio
Website

Re: Locked out of my server (Ubuntu 12.04.4 x32)

Post by imperio » Tue Jul 15, 2014 11:04 pm

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

Code: Select all

su root
Top

kerem
Posts: 2
Joined: Tue Jul 15, 2014 10:24 pm

Re: Locked out of my server (Ubuntu 12.04.4 x32)

Post by kerem » Wed Jul 16, 2014 2:15 am

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.
Top

imperio
VestaCP Team
Posts: 7000
Joined: Sat Dec 01, 2012 12:37 pm
Contact:
Contact imperio
Website

Re: Locked out of my server (Ubuntu 12.04.4 x32)

Post by imperio » Wed Jul 16, 2014 8:05 am

Give me admin access to vestacp
I want check this problem on your server

send me private message with password
Top

emardotcom
Posts: 54
Joined: Wed Dec 11, 2013 9:05 pm

Re: Locked out of my server (Ubuntu 12.04.4 x32)

Post by emardotcom » Mon Dec 08, 2014 3:11 am

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.
Top


Locked
  • Print view

5 posts • Page 1 of 1

Return to “Debian/Ubuntu”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password