Your first boot

From Computer Science

Guides> linux > Your first boot


Getting Started

Select your virtual machine from the list on the left.

Click the green "Start" arrow.

Watch the messages fly by.

After a few seconds, you should see a prompt like this:

Arch Linux 5.4.7-arch1-1-ARCH (tty1)

middlinux login:

(If you installed Linux yourself, "middlinux" will be replaced with whatever hostname you chose.)

There is currently no user account for you, so (*this time only*) log in as the generic administrative user, "root". If you used the prebuilt image, the password is "password" (we'll change it in a few minutes); if you installed it yourself, the password is whatever you set it to be during install.

(NB: the user "root" has complete, unfettered access to the entire machine. This means that if you're logged in as root and issue an ill-advised or mistyped command, you could really hose your system. Unless you have an extremely good reason, you should never log in as root. Instead, use the `sudo` program, which allows you to execute a program with temporarily elevated privileges.)

Upon successfully logging in, you should be presented with a shell prompt, indicating that the virtual machine is awaiting input:

[root@middlinux ~]#

Add a user

Since you are going to never log in directly as root, you need to create a user account you *will* use. In the following, replace "pete" with a username of your choice (as with the hostname, limit it to lowercase letters, numbers, and the underscore). Leave "wheel" as it is: this, in combination with the `sudo` program, is what will allow you to run a program with temporary administrator rights. Use the `id` program to verify afterwards. Use the `passwd` program to set the new user's password (note that it won't even print asterisks to let you know you're typing).

[root@middlinux ~]# useradd -m -G wheel pete
[root@middlinux ~]# id pete
uid=1000(pete) gid=1000(pete) groups=1000(pete),998(wheel)
[root@middlinux ~]# passwd pete
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Assuming this all works, log out by running `exit` and then attempt to log in as the newly-created user. Your prompt should now look similar to this:

[pete@middlinux ~]$

The "$" instead of the "#" indicates a user shell rather than a root shell.


Verify sudo works, and change root password if necessary

You will need to be able to run commands as root (ie, administrator) to, eg, install new software. The `sudo` program has been installed and configured, which allows you to temporarily take on root privileges to execute a specific command. You can verify it works by running the following command:

[pete@middlinux ~]$ sudo su

It will print a warning and prompt you for *your* password (ie, verifying that you are you, because the `sudo` configuration file says that you are allowed to run `sudo`), and then it should show a root shell prompt:

[root@middlinux ~]#

If you used the prebuilt install image, now is a good time to change the root password to something only you know:

[root@middlinux ~]# passwd

Note that nothing will be shown as you're typing (not even asterisks)!


Get graphical

BEFORE RUNNING THIS STEP - MAKE SURE YOU ARE NOT LOGGED INTO ROOT

You can now enter the graphical environment, XFCE:

DO NOT LOG INTO XFCE AS ROOT


[pete@middlinux ~]$ startxfce4

The first time you run XFCE, it will ask if you want to use a default config or just one empty panel. I would recommend the former until you're more comfortable tweaking settings to your taste. To exit from the graphical environment, click your username in the top right and select "Log Out".

Congratulations

You're done. Now there are just a couple things you *need* to know before you start exploring (like, you know, a text editor).