Posted April 4, 2016
Log into your server as root.
Create a new user account for yourself.
1 2 3 |
adduser james |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Adding user `james' ... Adding new group `james' (1000) ... Adding new user `james' (1000) with group `james' ... Creating home directory `/home/james' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for james Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] Y |
Now let’s give the new user “james” root/sudo permissions. Type ‘visudo’ to edit the /etc/sudoers file:
1 2 3 |
visudo |
Find the lines that look like this:
1 2 3 4 |
# User privilege specification root ALL=(ALL:ALL) ALL |
And add your new user underneath, following the same pattern as root:
1 2 3 4 5 |
# User privilege specification root ALL=(ALL:ALL) ALL james ALL=(ALL:ALL) ALL |
Save the file:
Press Control-X
Press the letter Y
Hit enter.
Now log out as root, and log in with your new account.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
login as: james james@208.82.89.36's password: Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64) * Documentation: https://help.ubuntu.com/ System information as of Sat Apr 23 23:44:44 CDT 2016 System load: 0.15 Processes: 73 Usage of /: 0.9% of 116.15GB Users logged in: 0 Memory usage: 0% IP address for eth0: 208.82.89.36 Swap usage: 0% ...etc. |
Finally, disable the root account using the ‘sudo’ command:
1 2 3 |
sudo passwd -l root |
1 2 3 |
passwd: password expiry information changed. |
For example:
1 2 3 |
sudo apt-get install icecast2 |
You’ll be prompted to enter your password if you haven’t used sudo for a few minutes prior, after which the command will run:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[sudo] password for james: Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: grub-pc-bin Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libogg0 libspeex1 libtheora0 libvorbis0a libxslt1.1 Suggested packages: ices2 speex The following NEW packages will be installed: icecast2 libogg0 libspeex1 libtheora0 libvorbis0a libxslt1.1 0 upgraded, 6 newly installed, 0 to remove and 6 not upgraded. Need to get 931 kB of archives. After this operation, 2,354 kB of additional disk space will be used. Do you want to continue [Y/n]? |
Speak Your Mind