"sudo npm -g .." modifies my /usr/bin/sudo modifies sudo file rights and ownership to docker each time


[folaht@pjehrsohmehj ~]$ sudo npm -g install emmet-ls
[sudo] Mot de passe de folaht :

added 12 packages, and audited 13 packages in 4s

found 0 vulnerabilities
[folaht@pjehrsohmehj ~]$ ls -lha /usr/bin/sudo
-rwxr-xr-x 1 root docker 163K 15 mrt 19:50 /usr/bin/sudo

This renders sudo useless and I have to login as root each time to fix this.

Also I have a ‘su’ issue:

[folaht@pjehrsohmehj ~]$ su
Password :
su: Authentication service cannot retrieve authentication info

Reset prefix away from root

npm config set prefix ~/.npm

Login as root and change sudo back to normal:

pxexec chmod 4755 /usr/bin/sudo
chown root:root /usr/bin/sudo

Remove all global npm apps installed on root.

sudo rm -rf /root/.npm

And from now on stop using sudo npm -g and do this instead:

npm -g install emmet-ls

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.