Osmc is not in the sudoers file. This incident will be reported

Hi,

I cant use Putty…when I try type SUDO I get this errpr

osmc is not in the sudoers file. This incident will be reported.

I must put sudo pasword for osmc…which is osmc…but still I cant use sudo…any info where is the problem and how to fix this…

thanks

You say you can’t use Putty but are trying to sudo. Are you successfully SSH’d into the device yet or is that your issue?

When I type command sudo I got this

osmc@osmc:~$ sudo apt-get update
[sudo] password for osmc:
osmc is not in the sudoers file. This incident will be reported.
osmc@osmc:~$

I can use Putty but if I want install deluge or samba with sudo command…I get this error…and yes I successfully SSHd with raspberry

There is something wrong. Sudo on OSMC would not ask for the password. Did you install any packages?
Suggest to provide a full log.

yes I am installed few packages…because I format everything and do clean install…I install Deluge…but after this work ok…next was Samba after samba I got this error…

You’ve probably lost the file /etc/sudoers.d/osmc-no-sudo-password

In that file should be:

osmc     ALL= NOPASSWD: ALL

How you have managed to lose that I have no idea… :slight_smile:

Why not Samba from the App Store, play safe

I dont know how I lose that…how can I fix this…which command I must put in Putty?

I always install Samba like this…without any issues…till now:)

You won’t be able to fix it while you are running OSMC normally because only root can create a sudoers.d file and you cannot become root because sudo is not working. :wink:

You would have to do something like add init=/bin/bash to your /boot/cmdline.txt from another machine, which would boot you directly to a root shell, then you could replace the missing file.

I am noob with Linx… and…I am pritty sure I cant fix this…if I reset raspberry…and do fresh install osmc. on sd card…in this case I will get back sudoers.d file?.

Of course.

I just format sd card…and now it is work:) thanks for help guys