[root@localhost ~]# vi /etc/ssh/sshd_config |
PermitRootLogin no ← no に変更する Protocol 2 ← SSH2でのみ接続を許可 SyslogFacility AUTHPRIV ← ログを/var/log/secureに記録する※CentOSデフォルトに合わせる PasswordAuthentication no ← パスワードでのログインを禁止(鍵方式によるログインのみ許可) PermitEmptyPasswords no ← パスワードなしでのログインを禁止 |
[root@centos ~]# echo Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com >> /etc/ssh/sshd_config |
[root@centos ~]# echo Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com >> /etc/ssh/ssh_config |
[root@localhost ~]# echo MACs hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com >> /etc/ssh/sshd_config |
[root@localhost ~]# echo MACs hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com >> /etc/ssh/ssh_config |
[root@centos ~]# usermod -G wheel <username> ← 管理者ユーザーをwheelグループに追加 |
[root@centos ~]# vi /etc/ssh/sshd_config ← SSHサーバー設定ファイル編集 |
以下を最終行へ追加 Match Group *,!wheel ChrootDirectory /home/%u/./ |
[root@localhost ~]# systemctl restart sshd |