デーモン
作成日時:2018/04/01
更新日時:2018/05/31
スポンサーリンク
SSHD設定ファイル
/etc/ssh/sshd_config
| キーワード | 引数に設定可能な値 | デフォルト値 | 説明 |
| Port | 数値 | 22 | sshdのポート番号を指定する |
| AddressFamily |
| any | アドレスファミリを指定する |
| ListenAddress |
| 全てのアドレス | sshdがリッスンするローカルアドレスを指定する |
| Protocol |
| 2,1 | サポートするプロトコルバージョンを指定する |
| HostKey | - | デフォルト値 | SSHで使用するプライベートホスト鍵を含むファイルを指定する |
| KeyRegenerationInterval | - | 3600秒 | 鍵の再生成間隔 |
| ServerKeyBits | 512以上の数値 | 1024 | サーバーキーのビット数を指定する |
| SyslogFacility |
| AUTH | - |
| LogLevel |
| INFO | メッセージのロギング時に使用される冗長レベルを指定する |
| LoginGraceTime | 時間 | 120秒 | ログインの猶予時間、0を指定すると制限時間を設けない |
| PermitRootLogin |
| yes | ルートのログイン許可設定 |
| StrictModes |
| yes | - |
| MaxAuthTries | 数値 | 6 | 接続ごとに許可される認証試行の最大回数を指定する |
| MaxSessions | 数値 | 10 | ネットワーク接続ごとに許可されるオープンセッションの最大数を指定する |
| RSAAuthentication |
| yes | 純粋なRSA認証が許可されるかどうかを指定する(プロトコルバージョン1にのみ適用される) |
| PubkeyAuthentication |
| yes | 公開鍵認証を許可するか設定する |
| AuthorizedKeysFile | ファイルパス(%hは認証されるユーザのホームディレクトリ、%uはそのユーザのユーザ名に置き換えられる) | .ssh/authorized_keys | ユーザー認証に使用できる公開鍵を含むファイルを指定する |
| AuthorizedKeysCommand | プログラム | プログラムを実行しない | ユーザーの公開鍵の参照に使用するプログラムを指定する |
| AuthorizedKeysCommandRunAs | ユーザ名 | 認証ユーザ | AuthorizedKeysCommandが実行されているアカウントのユーザーを指定する |
| RhostsRSAAuthentication |
| no | - |
| HostbasedAuthentication |
| no | - |
| IgnoreUserKnownHosts |
| no | - |
| IgnoreRhosts |
| yes | - |
| PasswordAuthentication |
| yes | パスワード認証を許可するか設定する |
| PermitEmptyPasswords |
| no | パスワード認証が許可されている場合、空のパスワードを持つユーザーのログインを許可するか設定する |
| ChallengeResponseAuthentication |
| yes | チャレンジレスポンス認証が許可されるかどうかを指定する |
| KerberosAuthentication |
| no | PasswordAuthenticationのためにユーザーから提供されたパスワードをKerberos KDCで検証するかどうかを指定する |
| KerberosOrLocalPasswd |
| yes | Kerberosによるパスワード認証が失敗した場合、/etc/passwdなどの追加のローカル・メカニズムを介して検証するか指定する |
| KerberosTicketCleanup |
| yes | ログアウト時にユーザーのチケットキャッシュファイルを自動的に破棄するかどうかを指定する |
| KerberosGetAFSToken |
| no | AFSがアクティブで、ユーザーがKerberos 5 TGTを使用している場合、ユーザーのホームディレクトリにアクセスする前にAFSトークンを取得するか指定する |
| KerberosUseKuserok |
| yes | ユーザーのエイリアスの.k5loginファイルを確認するかどうかを指定する |
| GSSAPIAuthentication |
| no | GSSAPIベースのユーザー認証を許可するかどうかを指定する(プロトコルバージョン2のみに適用される) |
| GSSAPICleanupCredentials |
| yes | ログアウト時にユーザーの資格情報キャッシュを自動的に破棄するかどうかを指定する(プロトコルバージョン2のみに適用される) |
| GSSAPIStrictAcceptorCheck |
| yes | - |
| GSSAPIKeyExchange |
| no | - |
| UsePAM |
| no | Pluggable Authentication Moduleインスターフェースを有効にするか設定する |
| AcceptEnv | - | 全ての環境変数を許可しない | - |
| AllowAgentForwarding |
| yes | ssh-agentの転送を許可するかどうかを指定する |
| AllowTcpForwarding |
| yes | TCP転送を許可するかどうかを指定する |
| GatewayPorts | - | - | - |
| X11Forwarding |
| no | X11転送を許可するかどうかを指定する |
| X11DisplayOffset | - | - | - |
| X11UseLocalhost | - | - | - |
| PrintMotd |
| yes | ログイン時に/etc/motdを出力するかどうかを指定する |
| PrintLastLog |
| yes | ログイン時にユーザーの最終ログイン日時を表示するか設定する |
| TCPKeepAlive | - | - | - |
| UseLogin | - | - | - |
| UsePrivilegeSeparation | - | - | - |
| PermitUserEnvironment |
| no | - |
| Compression | - | - | - |
| ClientAliveInterval | - | - | - |
| ClientAliveCountMax | - | - | - |
| ShowPatchLevel | - | - | - |
| UseDNS | - | - | - |
| PidFile | ファイルパス | /var/run/sshd.pid | SSHデーモンのプロセスIDを含むファイルを指定する |
| MaxStartups | 開始:レート:フル | 10:30:100 | - |
| PermitTunnel |
| no | - |
| ChrootDirectory | パス | chrootを使用しない | 認証後にchrootに渡すパスを指定する |
| Banner | ファイルパス | 表示なし | 指定ファイルの内容をログイン時に表示する(プロトコルバージョン2でのみ使用可能) |
| Subsystem | - | 定義なし | 外部サブシステムを設定する(プロトコルバージョン2のみに適用される) |
| Match | - | - | - |
エフェラメルポート
/proc/sys/net/ipv4/ip_local_port_range
起動スクリプト
/etc/rc.d/init.d/sshd
「/etc/init.d」が「/etc/rc.d/init.d」へのシンボリックリンクになっているので以下でも動作します
/etc/init.d/sshd
sshd起動
/etc/rc.d/init.d/sshd start
sshd停止
/etc/rc.d/init.d/sshd stop
sshd再起動
/etc/rc.d/init.d/sshd restart
インストール確認
インストールされているか
yum list installed | grep ssh
rpm -qa | grep ssh
インストール先
rpm -ql openssh-server
インストール
yum -y install openssh-server