# Should I disabled the root account after I have installed Virtualmin

**URL:** <https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282>\
**Category:** Help! (Home for newbies)\
**Created:** [October 31, 2023, 4:08pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282 "2023-10-31T16:08:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoulders](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/shoulders/32/10086_2.png) [@shoulders](https://forum.virtualmin.com/u/shoulders)\
**Post date:** [October 31, 2023, 4:08pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/1 "2023-10-31T16:08:59Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |
| OS type and version | Ubuntu Linux 22.04.3 |
| Webmin version | 2.101 |
| Usermin version | 2.001 |
| Virtualmin version | 7.8.2 |
| Theme version | 21.04 |
| Package updates | 45 package updates are available |

I enabled the root account in Unbuntu and then installed Virtualmin with the root account. The reason I believe the root account is disabled in Ubuntu by default is for security reasons.

So my question is, should I disable the root account **(sudo passwd -l root)** for security when I am done installing Virtualmin?

I am not a Linux expert and mainly work with Windowsm so what seems like a simple question for the community baffles me. 😀

thanks

---

<div class="post-metadata">

**Author:** ![sanjeevone](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/sanjeevone/32/11944_2.png) [@sanjeevone](https://forum.virtualmin.com/u/sanjeevone)\
**Post date:** [October 31, 2023, 4:11pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/2 "2023-10-31T16:11:18Z")

</div>

you can disable root login for ssh but you need root login to login into virtualmin.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [October 31, 2023, 4:17pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/3 "2023-10-31T16:17:13Z")

</div>

You don’t need `root` for Virtualmin. You need either a root user or an account that has `sudo` `ALL` privileges.

But, I would make sure you can login with that other user and that other user can do everything in Virtualmin before disabling root login.

---

<div class="post-metadata">

**Author:** ![Stegan](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/stegan/32/6860_2.png) [@Stegan](https://forum.virtualmin.com/u/Stegan)\
**Post date:** [October 31, 2023, 4:20pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/4 "2023-10-31T16:20:07Z")

</div>

> [@shoulders](#):
>
> I believe the root account is disabled in Ubuntu by default

is it really? not on any version of Ubuntu I have!

---

<div class="post-metadata">

**Author:** ![shoulders](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/shoulders/32/10086_2.png) [@shoulders](https://forum.virtualmin.com/u/shoulders)\
**Post date:** [October 31, 2023, 4:20pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/5 "2023-10-31T16:20:31Z")

</div>

Might be worth keeping the root account as backup access but remove it from SSH.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [October 31, 2023, 4:25pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/6 "2023-10-31T16:25:05Z")

</div>

By default, after a fresh Ubuntu installation, I believe `root` user will not have a password set. And, that’s been the case since around Xenial (16.06) or Trusty (14.04), maybe even earlier. Your first user will be configured with `sudo ALL` privileges. You can, of course, set a `root` password, and many hosting providers do that with their Ubuntu image.

---

<div class="post-metadata">

**Author:** ![shoulders](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/shoulders/32/10086_2.png) [@shoulders](https://forum.virtualmin.com/u/shoulders)\
**Post date:** [October 31, 2023, 4:28pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/7 "2023-10-31T16:28:02Z")

</div>

I have to set a password to be able to use `root`. So maybe me using the term enabled, disabled is probably wrong.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [October 31, 2023, 4:34pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/8 "2023-10-31T16:34:15Z")

</div>

I think most folks understand what you mean.

You do have to have a `root` user (many processes start with UID 0), but you can disable direct logins as root in a variety of ways. Using the “lock” option in `passwd`, as you mentioned above, is one (this sets the hashed password to start with `!`, which will never match a hash and thus prevent all authentication as this user). Disabling `root` logins in ssh is another (console root login still works). I tend to prefer the latter, as I like knowing I can get in on the console in the event everything else fails. But a sudo-capable user works for that, too, and you probably always still have single user mode, if you can get to the console.

---

<div class="post-metadata">

**Author:** ![shoulders](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/shoulders/32/10086_2.png) [@shoulders](https://forum.virtualmin.com/u/shoulders)\
**Post date:** [October 31, 2023, 4:38pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/9 "2023-10-31T16:38:22Z")

</div>

That all makes sense, thanks for the help.

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [November 8, 2023, 4:38pm UTC](https://forum.virtualmin.com/t/should-i-disabled-the-root-account-after-i-have-installed-virtualmin/123282/10 "2023-11-08T16:38:30Z")

</div>

Closed on November 8, 2023, 4:38pm UTC

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