LoginSignup
0

More than 5 years have passed since last update.

GMOクラウドVPSの初期設定メモ

Posted at

VPSをレンタルしてみたので設定をメモしておきます。

今回はGMOクラウドのVPSにしてみました。
入会金が他に比べて高いけど、一番安いメモリ1GBプランで780円からなのに惹かれました。

15日は無料で試用できます。

今回のOSはCentOS7.3です。

インストールされているOSの確認

cat /etc/redhat-release

rootパスワードの変更

初期設定されたrootでログイン後、
passwd

rootのパスワード変更方法 – さくらのサポート情報

一般ユーザの追加

useradd ユーザ名
passwd ユーザ名

一般ユーザの追加方法 – さくらのサポート情報

sudoの設定

「sudo」を利用したい一般ユーザを「wheel」グループに所属させる

usermod -G wheel ユーザ名

「wheel」グループに所属するユーザが「sudo」を利用できるように設定を変更する

visudo

## Allows people in group wheel to run all commands 
# %wheel ALL=(ALL) ALL 
→## Allows people in group wheel to run all commands 
%wheel ALL=(ALL) ALL

sudoの設定確認

一般ユーザでログイン後下記コマンドを実行
落ちたら手動でVPSを立ち上げなおして下さい

sudo shutdown -h now

sudoの設定方法 – さくらのサポート情報

システムのアップデート

yum -y update

システムのアップデート方法 – さくらのサポート情報

ファイアウォールの設定

CentOS7からiptablesのコマンドは使えないので下記を参考に設定

firewallの自動起動設定

systemctl enable firewalld

自動起動設定を確認

systemctl is-enabled firewalld

firewallのステータス表示

systemctl status firewalld

firewallの起動

systemctl start firewalld

firewallの停止

systemctl stop firewalld

有効な設定を確認

firewall-cmd --list-services --zone=public --permanent

設定を追加(http, https, ssh, mysql)

firewall-cmd --add-service=http --zone=public --permanent
firewall-cmd --add-service=https --zone=public --permanent
firewall-cmd --add-service=ssh --zone=public --permanent

5分で終わらせるCentOS7のfirewalld設定

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