Ubuntu: Samba file server won't let me login as root only as active-directory user



Question:

I made a 16.04 server installed with samba, winbind and some others using parts of this walk-through. It worked until I played with permissions (for some reason some folders were not accessible), now I find myself locked out of the server.

I can access the share on windows with my active directory username/passwd but I'm stuck outside the server and can only logon with the same active directory user/passwd.

If I try to get to root user it says the access is denied or authentication failed.

> me@ubuntu-fileserver:~$ sudo su    > sudo: unable to resolve host ubuntu-fileserver: Connection timed out    > [sudo] password for me:  me is not in the sudoers file.  This incident will be reported.   > me@ubuntu-fileserver:~$ su root    > Password:   Access is denied    > su: Authentication failure  

Is there a way to get root access back without reinstalling ?

EDIT: From liveCD or Recovery mode I only have a minute or so before this happens:

Everything stops

EDIT2: After making corrections to hosts/hostname (one was different), still cannot login as sudoer :

host localhost

localhost has address 127.0.0.1  Host localhost not found: 2(SERVFAIL)  Host localhost not found: 2(SERVFAIL)  

host ubuntu-fileserver

ubuntu-fileserver.domain.lo has address 192.168.0.57  

cat /etc/hostname

ubuntu-fileserver  

cat /etc/hosts

127.0.0.1 localhost   localhost.localdomain  127.0.1.1 ubuntu-fileserver  192.168.0.57  ubuntu-fileserver.domain.lo ubuntu-fileserver  192.168.0.3   dc1.domain.lo   dc1  192.168.0.5   dc2.domain.lo   dc2  # The following lines are desirable for IPv6 capable hosts  ::1     localhost ip6-localhost ip6-loopback  ff02::1 ip6-allnodes  ff02::2 ip6-allrouters  

I can ping all these addresses by ip or hostname no problem.


Solution:1

Resolve the host resolution

You're having problems with your host server resolution. This is configurable in your /etc/hosts.

You can fix this by:

Reboot your computer. At the grub prompt select Advance Options for Ubuntu and press ENTER. Go into Recovery Mode. (You may have to hit esc to disable the ping screen.) Continue with:

  1. Drop to root shell prompt
  2. ENTER for maintenance.
  3. Remount the root system with:
# sudo mount -o remount,rw /

Now edit your /etc/hosts ensure you have the following resolved to the ip 127.0.0.1.

  127.0.0.1    localhost.localdomain localhost  127.0.1.1    ubuntu-fileserver  

Resolve the sudo permission

While in the recover mode of the first section run this:

$ nano /etc/group  

Look for the sudo group:

Change from:

sudo:x:27:apollo

Change to:

sudo:x:27:apollo,yourID  

Add your using name to the contents of the file. The userID's needs to be separated by a comma to have more than one userID included.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »