Webmin Logo

The best way I have found to install Webmin on Ubuntu 11.04 – and to be able to log in once you do (important!) – is to use the following method.  It’s not 100% guaranteed but worked nicely for me.

__________________________________________________________________________________________________

UPDATE: I have recently tested the following process on Ubuntu 12.04(64) and found no issues with that distribution either. I am working on a step-by-step tutorial that shows you how to set up an Ubuntu web server on Amazon EC2 and then install Webmin. The trick there is setting security groups correctly so that you open up the right ports in order to access the Webmin browser interface. Coming soon!

___________________________________________________________________________________________________

1. Install Ubuntu Server 11.04 the usual way.

2. Go ahead and enable the SSH Server during the install.  You’ll need this later if you have to gain sudo access or if you want to go headless with no monitor.

3. My servers are across the room on a rack so I don’t really want to stand there while installing packages.  I used my Mac to ssh into the server.  Do this by firing up your terminal.

*if you want to do this directly on the server, that is fine too.  Just log in at the prompt.

4. For purposes of this example, let’s say my admin username in Ubuntu is “secretengineer” and the server’s IP is 192.168.0.113 (Which I have named SERVER3)

Enter the following at your terminal prompt

SEMac:~ pat$ ssh secretengineer@192.168.0.113

After accepting the certificate from the server, you should now see

secretengineer@192.168.0.113 password:

Enter the administrator password you chose when you installed Ubuntu.

Your terminal prompt will now change to

secretengineer@SERVER3:~$

You’re in.

5. Now install Webmin.  First thing to do is to edit your sources.list file in order to provide the location where Webmin is hosted.  This will allow you to use apt to go grab it easily.

6. Start vi.  If you don’t know vi don’t worry, not many people do.  They know parts.  But at some point, go through a tutorial because you’ll need to know how to use it to edit config files when you do clean installs like this one.

You will open and edit the sources.list file. Enter the following at the terminal prompt:

sudo vi /etc/apt/sources.list

7. Use your arrow keys and move the cursor down to the bottom of the file.

Type the letter “o” to enter INSERT mode and type or copy and paste the following lines:

deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib

Once you have done that, press the ESC key to exit INSERT mode and get back into visual command mode.  Now save the new file by typing:

:w <CR>

Then, all you have to do is type :q<CR> to quit vi.

8. In order to verify the integrity of the source, you will now need to import the GPG Key and add it.

wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc

9. Once all that is done, you now need to update the source list by running the command:

sudo apt-get update

10. NOW comes the fun part.  You will install Webmin:

sudo apt-get install webmin

Webmin now installs itself and you will be able to access it via a browser now at, in my case, https://192.168.0.113:10000.

You will see the login page:

Webmin LoginEnter your Username and Password that you signed on to your server with.

WAIT!  It keeps telling you that is wrong? You can’t log in?

Common.  Go ahead, Google it.  Seems there is a minor flaw in how Webmin provisions on Ubuntu that is quite common.

Before you keep pounding away on the login fields to no avail and the server finally locks you out for good until you either go to another computer or restart the server, there is a way to fix this issue.

And, like you, I searched Google for the answer.  The problem is, all the posts out there don’t tell you exactly how to to do this.  They’re close… but, I found a way that actually worked.

HOW TO ACCESS WEBMIN WHEN IT WON’T ACCEPT YOUR LOGIN:

Webmin ships with a root password reset script that allows you to change the password of the root administrator.  Webmin by default likes “root” although you might not have called yourself that when you installed Ubuntu.  To gain temporary access so that you can set up a “real” user and password, follow these instructions:

Webmin must be running.  Restart the server if it has locked you out for too many login attempts.

Login to your server using your Ubuntu username and password.

Enter the following:

cd /usr/share/webmin

sudo perl changepass.pl /etc/webmin root newpass1

The system will ask you for your Ubuntu admin password.  Enter it to run the above script.

You should see a confirmation that the password was changed for user, “root.”

Now, go back to your browser and try it again.  Enter Username: root, Password: newpass1

Webmin will now log you in.  Go to Webmin > Webmin Users and either add a new user or change the password on “root.”  I set up a new user who I use for all of my Webmin administrators because it’s easy to remember.  But if you like “root” you can use that too.

Just remember, your Server admin username is not necessarily your Webmin admin username although now that you can set up users in Webmin, it can be if you choose.