「CentOS初期設定まとめ」の版間の差分

提供: sha.ngri.la
移動先: 案内検索
(ページの作成:「==一般ユーザー追加とrootでのログイン禁止== useradd tara.ttm passwd tara.ttm」)
 
(一般ユーザー追加とrootでのログイン禁止)
1行目: 1行目:
 
==一般ユーザー追加とrootでのログイン禁止==
 
==一般ユーザー追加とrootでのログイン禁止==
  useradd tara.ttm
+
tara.ttmを追加する
  passwd tara.ttm
+
  > useradd tara.ttm
 +
  > passwd tara.ttm
 +
パスワードの設定
 +
> su
 +
# usermod  -G wheel tara.ttm
 +
> groups tara.ttm
 +
rootログイン禁止設定
 +
> sudo vi /etc/ssh/sshd_config
 +
 
 +
# PermitRootLogin yes
 +
をコメントアウトを外して
 +
PermitRootLogin no
 +
変更を反映する
 +
> sudo systemctl restart sshd.service

2020年12月24日 (木) 15:14時点における版

一般ユーザー追加とrootでのログイン禁止

tara.ttmを追加する

> useradd tara.ttm
> passwd tara.ttm

パスワードの設定

> su
# usermod  -G wheel tara.ttm
> groups tara.ttm

rootログイン禁止設定

> sudo vi /etc/ssh/sshd_config
# PermitRootLogin yes

をコメントアウトを外して

PermitRootLogin no

変更を反映する

> sudo systemctl restart sshd.service