Jump to content

Help with sudoers file issue - Ubuntu 14.04 Server

Hello all,

 

Running my own server on a Supermicro chassis and motherboard, and came across an issue after fudging up a virtual machine. I backed up the data I needed, shut it down, undefined the machine, and deleted the qcow2 and xml files for it. I then updated the host machine and rebooted that. After trying to build another VM to replace the borked up one, I am getting an error. I have asked on Reddit and Ask Ubuntu as well, but haven't gotten anywhere, just trying to cast a net out to see if anyone may be familiar with this...

 

I am VERY new to Ubuntu here or command line OS at all, so I am not really at all sure what to do here, and googling hasn't helped in the least.

I just ran an update on my Ubuntu Server 14.04 machine and rebooted. I haven't ever touched the sudoers file, so I am suspecting some installed package did, then my update the other day tried to change that, but not sure, best guess. I am trying to create a virtual machine, and I get this error, but I have NO WAY to make a choice, it just uses default choice after about 5 milliseconds, doesn't wait for user input. 

Is there some other way I can FORCE this modified sudoers thing to pop up again so that I can view the differences, or just replace it? The command I used that got this output is the following:

    sudo ubuntu-vm-builder kvm trusty  --hostname TEST-vm 

Here is the full output of the message in question. Also, not sure if the policy-rc.d thing is related, or what that does....

 

  Current default time zone: 'Etc/UTC'
    Local time is now:      Sun Dec 18 17:59:54 UTC 2016.
    Universal Time is now:  Sun Dec 18 17:59:54 UTC 2016.
    Run 'dpkg-reconfigure tzdata' if you wish to change it.
    
    invoke-rc.d: policy-rc.d denied execution of stop.
    invoke-rc.d: policy-rc.d denied execution of stop.
    invoke-rc.d: policy-rc.d denied execution of start.
    invoke-rc.d: policy-rc.d denied execution of restart.
    invoke-rc.d: policy-rc.d denied execution of start.
    
    Configuration file '/etc/sudoers'
     ==> Modified (by you or by a script) since installation.
     ==> Package distributor has shipped an updated version.
       What would you like to do about it ?  Your options are:
        Y or I  : install the package maintainer's version
        N or O  : keep your currently-installed version
          D     : show the differences between the versions
          Z     : start a shell to examine the situation
     The default action is to keep your current version.
    *** sudoers (Y/I/N/O/D/Z) [default=N] ? dpkg: error processing package sudo (--configure):
     EOF on stdin at conffile prompt
    invoke-rc.d: policy-rc.d denied execution of restart.
    Errors were encountered while processing:
     sudo
    E: Sub-process /usr/bin/dpkg returned an error code (1)

 

Gaming Rig - ASUS ROG Crosshair VIII Dark Hero, AMD Ryzen 7 5800X (stock), ND-D15 Chromax Black, MSI Gaming Gaming X Trio RTX 3070, Corsair Vengeance LPX 32Gig (2 x 16G) DDR4 3600 (stock), Phanteks Eclipse P500A, 5x Noctua NF-P14 redux-1500, Seasonic FOCUS PX-850, Samsung 870 QVO 2TB (boot), 2x XPG SX8200 Pro 2 TB NVMe (game libraries), 2x Seagate BarraCuda ST8000DM004 8TB (storage), 2x Dell (27") S2721DGF, 2x Asus (24") VP249QGR, Windows 10 Pro, SteelSeries Arctis 1 Wireless, Vive Pro 2, Valve Index

NAS /Plex Server - Supermicro SC826TQ-R800LPB (2U), X8DTN+, 2x E5620 (Stock), 72GB DDR3 ECC, 2x Samsung 860 EVO (500GB) (OS & Backup), 6x WD40EFRX (4TB) in RaidZ2, 2x WD 10TB white label (Easy Store shucks), 2x Q Series HDTS225XZSTA (256GB) ZIL & L2ARC mirrored, Ubuntu 20.04 LTS

Other Servers -2x Supermicro CSE-813M ABC-03 (1U), X9SCL, i3-2120 (stock), 8 Gigs DDR3, 4x Patriot Burst 120GB SSD (Raid10 OS array), Mushkin MKNSSDHL250GB-D8 NVMe (game drive), Ubuntu 20.04 LTS - RAID 10 failed after a power outage... dang.

Link to comment
Share on other sites

Link to post
Share on other sites

If you want to mend the sudoers file yourself, all you need in there is:

 

Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

root    ALL=(ALL:ALL) ALL

%sudo   ALL=(ALL:ALL) ALL

 

To edit it, first use the command:

su

Then input you root password

Then go:

nano /ect/sudoers

If you want to use sudo as your default user add:

insertusernamehere ALL=(ALL:ALL) ALL

Be careful with sudo since you can break things if you are wreckless.

Type "exit" in the command line to leave the root account.

Link to comment
Share on other sites

Link to post
Share on other sites

Thank you for the responses, I really appreciate it!!!

 

 

1 hour ago, Electronics Wizardy said:

Try switching to root with sudo -s or su then run it as root.

Running it as root gives the same exact output about the sudoers file, no VM created...

 

 

13 minutes ago, Masken said:

If you want to mend the sudoers file yourself, all you need in there is:

 


Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

root    ALL=(ALL:ALL) ALL

%sudo   ALL=(ALL:ALL) ALL

Be careful with sudo since you can break things if you are wreckless.

 

Running as root is what got me into this mess. Instead of just deleting a game directory and starting over again, a changing of file permissions on directories for a mod was botched while SSH'd from mobile device at the grocery store in the car with the kids waiting on the wife.. This is what did it on the virtual machine... ran it from the root directory instead of the mods directory for the game, whoops...

 

chmod 755 $(find / -type d)

 

I took a look at the Sudoers file, and DID find that there is one line, the Defaults line that has an extra path in there which doesn't exist on my system, not sure if that is doing it or not... the "snap/bin" directory. 

 

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

 

Gaming Rig - ASUS ROG Crosshair VIII Dark Hero, AMD Ryzen 7 5800X (stock), ND-D15 Chromax Black, MSI Gaming Gaming X Trio RTX 3070, Corsair Vengeance LPX 32Gig (2 x 16G) DDR4 3600 (stock), Phanteks Eclipse P500A, 5x Noctua NF-P14 redux-1500, Seasonic FOCUS PX-850, Samsung 870 QVO 2TB (boot), 2x XPG SX8200 Pro 2 TB NVMe (game libraries), 2x Seagate BarraCuda ST8000DM004 8TB (storage), 2x Dell (27") S2721DGF, 2x Asus (24") VP249QGR, Windows 10 Pro, SteelSeries Arctis 1 Wireless, Vive Pro 2, Valve Index

NAS /Plex Server - Supermicro SC826TQ-R800LPB (2U), X8DTN+, 2x E5620 (Stock), 72GB DDR3 ECC, 2x Samsung 860 EVO (500GB) (OS & Backup), 6x WD40EFRX (4TB) in RaidZ2, 2x WD 10TB white label (Easy Store shucks), 2x Q Series HDTS225XZSTA (256GB) ZIL & L2ARC mirrored, Ubuntu 20.04 LTS

Other Servers -2x Supermicro CSE-813M ABC-03 (1U), X9SCL, i3-2120 (stock), 8 Gigs DDR3, 4x Patriot Burst 120GB SSD (Raid10 OS array), Mushkin MKNSSDHL250GB-D8 NVMe (game drive), Ubuntu 20.04 LTS - RAID 10 failed after a power outage... dang.

Link to comment
Share on other sites

Link to post
Share on other sites

Well.... while I will STILL have to fix this issue with the sudoers file, I DID manage to get the virtual machine up and running again, on a months old version. Back a few months I threw a 128 gig SSD into the server for this VM (for Minecraft server duties), and migrated from the RaidZ2 pool to that SSD. I copied the qcow2 file and xml file and never removed the old one. I just recopied the old back up, defined it, started it and it is working. All that is left THERE is to figure out how to move my back up file back to the server, extract the files and get them to the correct places. (I set up the auto-backups from the VM to the host machine running the NAS, and forgot the username and password for that, so will have to get that sorted too.) I am pretty happy with the progress I made today though.

Gaming Rig - ASUS ROG Crosshair VIII Dark Hero, AMD Ryzen 7 5800X (stock), ND-D15 Chromax Black, MSI Gaming Gaming X Trio RTX 3070, Corsair Vengeance LPX 32Gig (2 x 16G) DDR4 3600 (stock), Phanteks Eclipse P500A, 5x Noctua NF-P14 redux-1500, Seasonic FOCUS PX-850, Samsung 870 QVO 2TB (boot), 2x XPG SX8200 Pro 2 TB NVMe (game libraries), 2x Seagate BarraCuda ST8000DM004 8TB (storage), 2x Dell (27") S2721DGF, 2x Asus (24") VP249QGR, Windows 10 Pro, SteelSeries Arctis 1 Wireless, Vive Pro 2, Valve Index

NAS /Plex Server - Supermicro SC826TQ-R800LPB (2U), X8DTN+, 2x E5620 (Stock), 72GB DDR3 ECC, 2x Samsung 860 EVO (500GB) (OS & Backup), 6x WD40EFRX (4TB) in RaidZ2, 2x WD 10TB white label (Easy Store shucks), 2x Q Series HDTS225XZSTA (256GB) ZIL & L2ARC mirrored, Ubuntu 20.04 LTS

Other Servers -2x Supermicro CSE-813M ABC-03 (1U), X9SCL, i3-2120 (stock), 8 Gigs DDR3, 4x Patriot Burst 120GB SSD (Raid10 OS array), Mushkin MKNSSDHL250GB-D8 NVMe (game drive), Ubuntu 20.04 LTS - RAID 10 failed after a power outage... dang.

Link to comment
Share on other sites

Link to post
Share on other sites

Quote

I took a look at the Sudoers file, and DID find that there is one line, the Defaults line that has an extra path in there which doesn't exist on my system, not sure if that is doing it or not... the "snap/bin" directory. 

Yeah, to be honest I don't actually know what that line does. I am running debian so it might be different. You can try making a backup of your sudoers file, add my line or just comment it out with a # and add my line. You could also try to find a default ubuntu sudoers file and copy that.

 

For the stuff you have left to do, you could ask a direct question and I'll make sure to try and help.

Link to comment
Share on other sites

Link to post
Share on other sites

It make me really nervous to mess with it, since this is the sudoers file on the main host, issues could effect the NAS running on the host, and the media and game virtual machines.

 

Might you know if there is a specific way to force the system to show me the differences in the modified file vs what is there now? 

Gaming Rig - ASUS ROG Crosshair VIII Dark Hero, AMD Ryzen 7 5800X (stock), ND-D15 Chromax Black, MSI Gaming Gaming X Trio RTX 3070, Corsair Vengeance LPX 32Gig (2 x 16G) DDR4 3600 (stock), Phanteks Eclipse P500A, 5x Noctua NF-P14 redux-1500, Seasonic FOCUS PX-850, Samsung 870 QVO 2TB (boot), 2x XPG SX8200 Pro 2 TB NVMe (game libraries), 2x Seagate BarraCuda ST8000DM004 8TB (storage), 2x Dell (27") S2721DGF, 2x Asus (24") VP249QGR, Windows 10 Pro, SteelSeries Arctis 1 Wireless, Vive Pro 2, Valve Index

NAS /Plex Server - Supermicro SC826TQ-R800LPB (2U), X8DTN+, 2x E5620 (Stock), 72GB DDR3 ECC, 2x Samsung 860 EVO (500GB) (OS & Backup), 6x WD40EFRX (4TB) in RaidZ2, 2x WD 10TB white label (Easy Store shucks), 2x Q Series HDTS225XZSTA (256GB) ZIL & L2ARC mirrored, Ubuntu 20.04 LTS

Other Servers -2x Supermicro CSE-813M ABC-03 (1U), X9SCL, i3-2120 (stock), 8 Gigs DDR3, 4x Patriot Burst 120GB SSD (Raid10 OS array), Mushkin MKNSSDHL250GB-D8 NVMe (game drive), Ubuntu 20.04 LTS - RAID 10 failed after a power outage... dang.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Ziggidy said:

It make me really nervous to mess with it, since this is the sudoers file on the main host, issues could effect the NAS running on the host, and the media and game virtual machines.

The sudoers file doesn't affect anything other than the use of the sudo command. So just make a backup of it and try, it can't break anything other than you not being able to use sudo. Anything already running could not be affected and then you can just restore it with the backup.

 

Easy way to backup is:

su

cp /etc/sudoers /etc/sudoers.old

To remove your experiment and restore:

su

rm /etc/sudoers

mv /etc/sudoers.old /etc/sudoers

 

Quote

Might you know if there is a specific way to force the system to show me the differences in the modified file vs what is there now? 

Not that I know of.

Link to comment
Share on other sites

Link to post
Share on other sites

Thank you!!

Gaming Rig - ASUS ROG Crosshair VIII Dark Hero, AMD Ryzen 7 5800X (stock), ND-D15 Chromax Black, MSI Gaming Gaming X Trio RTX 3070, Corsair Vengeance LPX 32Gig (2 x 16G) DDR4 3600 (stock), Phanteks Eclipse P500A, 5x Noctua NF-P14 redux-1500, Seasonic FOCUS PX-850, Samsung 870 QVO 2TB (boot), 2x XPG SX8200 Pro 2 TB NVMe (game libraries), 2x Seagate BarraCuda ST8000DM004 8TB (storage), 2x Dell (27") S2721DGF, 2x Asus (24") VP249QGR, Windows 10 Pro, SteelSeries Arctis 1 Wireless, Vive Pro 2, Valve Index

NAS /Plex Server - Supermicro SC826TQ-R800LPB (2U), X8DTN+, 2x E5620 (Stock), 72GB DDR3 ECC, 2x Samsung 860 EVO (500GB) (OS & Backup), 6x WD40EFRX (4TB) in RaidZ2, 2x WD 10TB white label (Easy Store shucks), 2x Q Series HDTS225XZSTA (256GB) ZIL & L2ARC mirrored, Ubuntu 20.04 LTS

Other Servers -2x Supermicro CSE-813M ABC-03 (1U), X9SCL, i3-2120 (stock), 8 Gigs DDR3, 4x Patriot Burst 120GB SSD (Raid10 OS array), Mushkin MKNSSDHL250GB-D8 NVMe (game drive), Ubuntu 20.04 LTS - RAID 10 failed after a power outage... dang.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×