0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ConoHa vps 初期設定(ubuntu16.01)

Last updated at Posted at 2018-02-11

ConoHa VPSを初期設定する

SSHでrootでログイン

##hostnameを変更する

hostnamectl set-hostname xxxx

/etc/hosts
の127.0.1.1も変更する

##ユーザの追加

rootでログイン可能となっているので

ユーザを追加

adduser xxxx

sudo グループに追加

gpasswd -a xxxx sudo

##rootログイン禁止

vi /etc/ssh/sshd_config

/etc/ssh/sshd_config
PermitRootLogin yes 
=>
PermitRootLogin no

sshdの再起動

service ssh restart

SSHをもう一つ立ち上げて、作成したユーザでログインしてみる

##ufwの設定など

アップグレードする

sudo apt-get upgrade

firewallを有効
sudo ufw enable

ステータスの確認
sudo ufw status verbose

デフォルトを遮断
sudo ufw default deny

192.168.1.1からのSSHを許可
sudo ufw allow from 192.168.1.1 to any port 22

80版ポートを開放
sudo ufw allow 80

ステータスを確認
sudo ufw status numbered

削除
sudo ufw delete 番号

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?