It is a home computer with only one user.
These commands have been used:
chown root:root /usr/bin/apt-get
chmod 4775 /usr/bin/apt-get
How to reverse the commands and restore defaults?
It is a home computer with only one user.
These commands have been used:
chown root:root /usr/bin/apt-get
chmod 4775 /usr/bin/apt-get
How to reverse the commands and restore defaults?
Remove the dangerous setuid bit
Nothing else is wrong.
To add a little more detail, here are the defaults:
The command mentioned in the question added the setuid bit, shown as a leading
4
in octal permissions and ans
in place of thex
for owner in the human-readable form:The setuid bit allows the user executing the program to do so with the EUID of its owner. In this case, it means the normal user running
apt-get
does so as root by default. Sinceapt-get
is capable of completely destroying your system, as pointed out in comments by David Foerster and cat, giving it this permission setting (especially since the execute bit for others is set, as it is in this case, allowing literally any user to run the program) is extremely insecure.The setuid bit, always kept to a minimum, is present by necessity on the
sudo
programTo make this more secure, there is a strict policy about who may use
sudo
, configured in/etc/sudoers
. If that file is corrupted or is not present, or if the permissions ofsudo
are wrong,sudo
exits with errors.