- コンソールからサーバー起動
-
サーバーにログインしてみる
ssh IPアドレス
-
作業用ユーザーを追加する
useradd ユーザーネーム
-
作業用ユーザーにパスワードを設定する
passwd ユーザーネーム
-
ユーザーのグループを確認
groups ユーザーネーム
-
sudo
を使えるように、ユーザーのグループを変更するusermod -G wheel ユーザーネーム
-
sudo
が使えるか試してみるsu - ユーザーネーム sudo pwd # -> /home/ユーザーネームとか出る
-
サーバーから一旦ログアウトして、作成したユーザーでログインできるか確認する
exit ssh ユーザーネーム@IPアドレス
-
鍵認証でログインできるようにする
mkdir .ssh chmod 700 touch .ssh/authorized_keys chmod 600 .ssh/authorized_keys vi .ssh/authorized_keys # ローカルの公開鍵をコピペする
-
ルートログイン、パスワードログインを禁止する
sudo vi /etc/ssh/sshd_config # PermitRootLogin no / PasswordAuthentication no 左記の該当箇所を設定
-
設定を反映させるためにsshdをリスタートする
sudo service sshd restart
-
yumを最新にする
sudo yum -y update
-
apacheのインストール
sudo yum -y install httpd
-
apacheの起動
sudo systemctl start httpd.service sudo systemctl status httpd.service # 起動チェック
-
apacheの自動起動設定
sudo systemctl enable httpd.service sudo systemctl is-enabled httpd # 設定されたかチェック
-
ファイアウォールでhttp通信を許可するよう設定
sudo firewall-cmd --permanent --zone=public --add-service=http sudo firewall-cmd --reload sudo firewall-cmd --zone=public --list-all
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
21