9月 04, 2019 Linux Ubuntu
### Why you need to disable root login from SSH?
Allow root login from remote server is danger and it is no recommended. Because root account has the highest privilege to modify the whole system. You may replace root login by using `SUDO` command with `SUDO` enabled users or login to SSH by using SSH Key.

### How to disable root login
We can follow the steps below to disable root (or specified user) login via SSH:

Step 1. Edit /etc/ssh/sshd_config
```sh
$ vi /etc/ssh/sshd_config
```

Step 2. Find the following line and set the value to `no`
```sh
PermitRootLogin no
```

If you want to disable specified user, you may change the following line:
```sh
DenyUsers USERNAME
```

Step 3. Restart SSH service

Finish ! 
過去文章
2025 (9)
4 (5)
3 (1)
2 (3)
2024 (25)
11 (3)
10 (3)
9 (1)
3 (18)
2022 (6)
10 (1)
6 (2)
5 (1)
3 (1)
1 (1)
2021 (21)
11 (7)
7 (1)
6 (2)
5 (2)
4 (6)
3 (2)
2 (1)
2020 (92)
12 (1)
11 (2)
10 (4)
9 (10)
8 (5)
7 (1)
6 (3)
5 (1)
4 (4)
3 (25)
2 (7)
1 (29)
2019 (57)
12 (25)
11 (7)
9 (25)