Sure, just comment out admin
in the list of reserved usernames before launching the installer. You don't need to remaster the ISO for this, though you could if you wanted.
The graphical installer on the desktop ISOs for Ubuntu and most of its official derivatives is Ubiquity. This is the installer pictured in the screenshot shown in your question. It keeps a list of reserved usernames in /usr/lib/ubiquity/user-setup/reserved-usernames
.
Boot from a live USB or live DVD. Select the option to try Ubuntu, rather than the option to install it, since you should modify that file before running the installer.
Then comment out the admin
line in that file by placing #
at the front of the line. One way to do this is to run this one command:
sudo sed -i.orig 's/^admin$/# &/' /usr/lib/ubiquity/user-setup/reserved-usernames
Or, if you prefer, you can open the file in a text editor and manually make and save your changes:
sudoedit /usr/lib/ubiquity/user-setup/reserved-usernames
After modifying the file, double-click on the icon on the desktop to install Ubuntu.
I've tested this with the Ubuntu 18.04.3 LTS (amd64) desktop image.
If you feel like remastering the ISO image to avoid having to do that, you can. Any of the popular methods should work, since you're just changing one file inside the squashfs image. But if you only need this for a handful of installations, it's probably not worth it, since you can just run that one sed
command (or equivalent) each time before launching the installer.
When you use this method, an admin
group will be created and it will be used as the admin
user's primary group. The admin
user's UID will be 1000, and the admin
group's GID will be 1000 as well. I don't think you need to change this, but it's a good idea to be aware of its significance.
I presume you intend the user you create during installation and name admin
to be an administrator of the system who is permitted to run arbitrary commands as root (or any user) with sudo
. So it shouldn't be a problem that Ubuntu's /etc/sudoers
still confers those privileges to members of the admin
group as well as the sudo
group, even though membership in the admin
group is no longer a common or recommended way to give a user these privileges.
Ubuntu's default /etc/sudoers
contains these lines:
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
You could comment out the %admin
line if you wanted. Run sudo visudo
to edit the file. But you really don't need to.
Even though it's easy to make the installer let you proceed with the username admin
, I encourage you to consider the workaround of just not making a user called that, for two reasons:
Creating a user called admin
on Ubuntu, especially during installation, is not tested. In my limited testing, it doesn't seem to cause any problems, but I can't be sure it doesn't trigger or exacerbate any current or future bugs.
admin
is an easily guessed username. When examining the logs of Internet-facing SSH servers, I've noticed that admin
is one of the nonexistent users that receive a high volume of automated illicit login attempts.
It's often not necessary or worthwhile to keep usernames secret. But admin
is both easily guessed and attractive-sounding to people who want to break into your system.
Of course, some usernames, like root
, are even more ubiquitous and attractive. This is why allowing root logins is discouraged, especially password-based logins.
If your motivation for using the name admin
is that this username is hidden in some utilities or display managers, it's likely you can configure them to hide another name.
With that said, so long as you otherwise follow good security practices, including the use of strong passwords, I wouldn't expect any problems.
sudo
as a user/group).