I was working on some SFTP via filezilla to allow download and reupload of some file I took owner ship via ROOT and chown -R 'myusername' /etc and chmod 777 my user account for -R /etc
Now I got timed out and tried to login to root again and it gives me error sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin I have access to the /etc and 777 on all the files and also can access them via FTP so please suggest how to restore access to the root account Also the root as no password at this time so i cant run the general pkexec or visudo commands.
Please suggest a solution and also if there is a way to manually reset the /etc/shadow or passwd files.
I think it is slightly different than the indicated duplicate Becuse i changed the permissions on the files too. Also if i run chown root:root /etc/ it will give me chown root:root /etc chown: changing ownership of '/etc': Operation not permitted
Thank You!
THis returned : -rwxrwxrwx 1 offc offc 755 Jul 4 2017 sudoers drwxrwxrwx 2 offc root 4096 Jun 8 01:22 sudoers.d – Franc Giovanni Jun 08 '18 at 02:23
drwxrwxrwx 2 offc root 4096 Jun 8 01:22 . drwxrwxrwx 109 offc root 4096 Jun 8 02:14 .. -rwxrwxrwx 1 offc root 126 Mar 4 01:50 90-cloud-init-users -rwxrwxrwx 1 offc root 958 Mar 30 2016 README -r--r----- 1 root root 47 Jun 8 01:32 waagent
– Franc Giovanni Jun 08 '18 at 02:29