본문 바로가기

My list/IT

[Digitalocean] 1. Initial Server Setup with Ubuntu 18.04

Digital Ocean

  • 가입 후 개인 신용카드 정보 등록, droplets에서 서버만들기
  • 가상 서버 호스팅(VPS) : 물리적인 서버를 가상화하여 각각의 가상 서버를 사용자에게 제공하는 방식으로, 물리 서버 한 대에 여러 개의 가상 서버를 입주가능 (ex.Digital Ocean (월 5$))

 


 

Step 1 — Logging in as Root

root로 로그인 후 메일로 받은 임시 비밀번호로 계정 비밀번호 변경

 

 

Step 2 — Creating a New User

Once you are logged in as root, we're prepared to add the new user account that we will use to log in from now on.

This example creates a new user called sammy, but you should replace it with a username that you like:

# adduser sammy

You will be asked a few questions, starting with the account password.

Enter a strong password and, optionally, fill in any of the additional information if you would like. This is not required and you can just hit ENTER in any field you wish to skip.

 

 

Step 3 — Granting Administrative Privileges

Now, we have a new user account with regular account privileges. However, we may sometimes need to do administrative tasks.

To avoid having to log out of our normal user and log back in as the root account, we can set up what is known as "superuser" or root privileges for our normal account. This will allow our normal user to run commands with administrative privileges by putting the word sudo before each command.

To add these privileges to our new user, we need to add the new user to the sudo group. By default, on Ubuntu 18.04, users who belong to the sudo group are allowed to use the sudo command.

As root, run this command to add your new user to the sudo group (substitute the highlighted word with your new user)

# usermod -aG sudo sammy

Now, when logged in as your regular user, you can type sudo before commands to perform actions with superuser privileges.



/ 출처Initial Server Setup with Ubuntu 18.04 :https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04