LoginSignup
4
10

More than 5 years have passed since last update.

CentOS7.1 SSH接続許可(rootユーザ)

Posted at

概要

CentOS7.1のSSHログインを許可します。
通常はrootでのログインは許可しませんが、評価環境なので許可にします。

手順

CentOS7.1では最小限のインストールでも、opensshがデフォルトでインストールされているため、
/etc/ssh/sshd_config を編集すればログイン可能になります。

#vi /etc/ssh/sshd_config

SnapCrab_2015-11-22_No-00.png

行番号が分らないので表示させます。

:set number

SnapCrab_2015-11-22_No-01.png

表示されました
SnapCrab_2015-11-22_No-02.png

49行目にあるコメントを解除します。
PermitRootLogin yes
SnapCrab_2015-11-22_No-03.png

78行目付近を以下のものに変えます。
PermitEmptyPasswords no
PasswordAuthentication yes
SnapCrab_2015-11-22_No-04.png

:wq で上書き保存
SnapCrab_2015-11-22_No-05.png

サービスの再起動をすると有効になります。
ステータスを表示し、active (runnning) となっていれば問題ありません。

# systemctl restart sshd
# systemctl status sshd

SnapCrab_2015-11-22_No-06.png
SnapCrab_2015-11-22_No-07.png
SnapCrab_2015-11-22_No-08.png

ログインできました!
SnapCrab_2015-11-22_No-09.png

4
10
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
4
10