I have added my user name to /etc/sudoers:
- Code: Select all
# visudo
- Code: Select all
PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH
- Code: Select all
sudo getent shadow root|cut -d : -f 2
# visudoPATH=/sbin:/usr/sbin:/usr/local/sbin:$PATHsudo getent shadow root|cut -d : -f 2globetrotterdk wrote:Is disabling the root account recommended after having implemented sudo?
sudo /bin/shglobetrotterdk wrote:
- Code: Select all
sudo getent shadow root|cut -d : -f 2
Shador wrote:globetrotterdk wrote:Is disabling the root account recommended after having implemented sudo?
No, not unless you use a weak password for it. It's just an additional "incentive" not to become root anymore. Although that can still be circumvented with:
- Code: Select all
sudo /bin/sh
Yes. I saw that posted on an Ubuntu forum as an alternative to deleting the root account. Mileage of course may vary.Shador wrote:globetrotterdk wrote:
- Code: Select all
sudo getent shadow root|cut -d : -f 2
Context? This line just extracts the hashed password from the password database.
gapan wrote:First of all, there is no way anyone can disable the root account. You may choose not to use it, but you can't disable it. You may think that *buntu has it disabled but you're mistaken. There is a root user account, it just has a random password assigned to it, so you can't use it.
That said, I see no reason why you would want to do anything like that.
globetrotterdk wrote:Just inquiring about the correct procedure when sudo is being used.
gapan wrote:You can set the user password to something terribly complex that you won't be able to remember in the next second, something like "KrofukkK!@6eyzyfeY8@I%&5deTmbd$aafFT9UEtSxoS6i5ykA". That way you will have effectively "disabled" the root user account, since you won't be able to use it (not directly anyway, as stated before there are workarounds of course - this is what *buntu does). But I don't see how that is different than just not giving the root password to every other user and choosing not to use the root user yourself.
Shador wrote:Actually you can lock or disable an account by putting '!' resp. '*' into the password field. Additionally you can replace the default shell with /bin/false. https://administratosphere.wordpress.co ... ow-format/
thenktor wrote:globetrotterdk wrote:Just inquiring about the correct procedure when sudo is being used.
The correct procedure is not to use sudo![]()
![]()