正在顯示「 2020 年 11 月 」的所有結果
11月 12, 2020 Ubuntu
> Source: https://www.vultr.com/docs/update-ubuntu-server-best-practices

### Introduction

It is a best practice to update your server on a regular schedule for security and stability. Use this guide to keep your Ubuntu server updated.

Supported Versions
This guide applies to:

- Ubuntu 20.04 LTS
- Ubuntu 19.10
- Ubuntu 18.04 LTS
- Ubuntu 16.04 LTS

### Make a Backup

Always make a backup before updating your system.

### 1. Update the Package Lists

This command updates the package lists from the enabled repositories.

```sh
$ sudo apt update
```

### 2. List the Upgradable Packages

This step is optional. To view the upgradable packages before performing the upgrade, use the apt list command.

```sh
$ sudo apt list --upgradable
```

### 3. Upgrade Packages

This command will upgrade all the upgradeable packages.

```sh
$ sudo apt upgrade
```

### 4. Restart the Server

```sh
$ sudo reboot
```

### One Line Upgrade

If you want to accept all the defaults and perform the upgrade without intervention, use this command:

```sh
$ sudo apt update && sudo apt upgrade -y
```

### Optional - Autoremove

Use apt to remove old packages and dependencies automatically.

```sh
$ sudo apt autoremove
```
11月 11, 2020 Ubuntu
> Source: https://www.vultr.com/docs/create-a-sudo-user-on-ubuntu-best-practices

### Introduction

Performing server administration as a non-root user is a best practice for security. After launching your Vultr VPS, your first task as root should be to set up a non-root user with sudo access.

This guide applies to the following versions:

- Ubuntu 20.04 LTS
- Ubuntu 19.10
- Ubuntu 18.04 LTS
- Ubuntu 16.04 LTS

### 1. Add a New User Account

Create a new user account with the `adduser` command. Use a strong password for the new user. You can enter values for the user information, or press `ENTER` to leave those fields blank.

```sh
# adduser example_user
```

### 2. Add the User to the Sudo Group

Add the new user to the sudo group with usermod.

```sh
# usermod -aG sudo example_user
```

### 3. Test

Switch to the new user.

```sh
# su - example_user
```

Verify you are the new user with whoami, then test sudo access with sudo whoami, which should return root.

```sh
$ whoami
example_user
$ sudo whoami
[sudo] password for example_user:
root
```
過去文章
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)