Skip to content

Commit 2a5aac8

Browse files
committed
fixing typos and minor adjustments to content
1 parent 4f45c50 commit 2a5aac8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/03.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ However, if you really, *really* want to use `root`, there are ways to do it in
4242

4343
However, if you created a VM [locally](https://linuxupskillchallenge.org/00-Local-Server/) or with [other VPS providers](https://linuxupskillchallenge.org/00-VPS-small/), it is very likely that you have your `root` user readily available.
4444

45-
Stop using root. If you followed the guides, you should have created a regular user and adding it to a sudoers group, like this:
45+
Stop using root. If you followed the guides, you should have created a regular user and added it to a sudoers group, like this:
4646

4747
`adduser snori74`
4848

@@ -63,7 +63,7 @@ Your server is protected by the fact that its security updates are up to date, a
6363
## THE POWER OF SUDO
6464

6565
* Use the links in the "Resources" section below to understand how `sudo` works
66-
* Use `ls -l` to check the permissions of `/etc/shadow` - notice that only `root` has any access. Can you use `cat`, `less` or `nano` to view it?
66+
* Use `ls -l` to check the permissions of `/etc/shadow` - notice that only `root` has any access. Try `cat /etc/shadow`, can you view the contents of the file?
6767
* This file is where the hashed passwords are kept. It is a prime target for intruders - who aim to grab it and use offline password crackers to discover the passwords.
6868
* Now try with `sudo`, e.g. `sudo cat /etc/shadow`
6969
* Test running the `reboot` command, and then via `sudo` (i.e. `sudo reboot`)
@@ -73,7 +73,7 @@ Once you've reconnected back:
7373
* Use the `uptime` command to confirm that your server did actually fully restart
7474
* Test fully “becoming root” by the command `sudo -i`. This can be handy if you have a series of commands to do "as root". Note the change to your prompt.
7575
* Type `exit` or `logout` to get back to your own normal “support” login.
76-
* Use `less` to view the file `/var/log/auth.log`, where any use of `sudo` is logged
76+
* Use `cat /var/log/auth.log`, to see the last few times `sudo` was logged
7777
* You could "filter" this by typing: `grep "sudo" /var/log/auth.log`
7878

7979
*Normally invoking the `sudo` command will ask you to re-confirm your identity with your password. However, this can be changed in the sudoers configuration file so it does NOT prompt for a password.*
@@ -82,7 +82,7 @@ Once you've reconnected back:
8282

8383
We will go into detail of the many things you can do to your server, but here are some examples of simple administrative tasks that require `sudo`.
8484

85-
If you wish to, you can now rename your server. Traditionally you would do this by editing two files, `/etc/hostname` and `/etc/hosts` and then rebooting - but the more modern, and recommended, way is to use the `hostnamectl` command; like this:
85+
If you wish to, you can now rename your server. Traditionally you would do this by editing two files, `/etc/hostname` and `/etc/hosts` and then rebooting - but the more modern, and recommended, way is to use the `hostnamectl` command, like this:
8686

8787
`sudo hostnamectl set-hostname mylittlecloudbox`
8888

@@ -112,12 +112,14 @@ Confirm:
112112

113113
The major practical effects of this are (1) the timing of scheduled tasks, and (2) the timestamping of the logs files kept under `/var/log`. If you make a change, there will naturally be a "jump" in the dates and time recorded.
114114

115-
## WRAP
115+
## WITH GREAT POWERS COMES GREAT RESPONSIBILITY
116116

117117
As a Linux sysadmin you may be working on client or custom systems where you have little control, and many of these will default to doing everything as `root`. You need to be able to safely work on such systems - where your only protection is to double check before pressing `Enter`.
118118

119119
On the other hand, for any systems where you have full control, setting up a "normal" account for yourself (and any co-admins) with permission to run `sudo` is recommended. While this is standard with Ubuntu, it's also easy to configure with other popular server distros such as Debian, CentOS and RHEL.
120120

121+
Even with that, it's important to take the necessary precautions before making global changes, to prevent accidentally locking yourself out or other issues. Practices like using a test environment, checking for syntax errors and typos, and keeping an eye on the log files, will eventually become second nature.
122+
121123
## EXTENSION
122124

123125
* [How To Edit the Sudoers File](https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file)

0 commit comments

Comments
 (0)