OpenSSH サーバープログラムの実体は、sshd というデーモンです。Turbolinux 11 Server で sshd の起動や停止を行うには、/etc/init.d/sshd スクリプトに以下のオプションを指定して実行します。
表 21-2. /etc/init.d/sshd
| オプション | 説明 |
|---|---|
| start | sshd デーモンを起動します。ホスト認証用鍵が存在しない場合にのみ、起動前にこれらを作成します。 |
| stop | sshd デーモンを停止します。 |
| restart | sshd デーモンを再起動します。stop のあとに start を実行します。 |
| status | sshd デーモンの起動状態を確認します。 |
| reload | 設定ファイルを再読込みします。 |
| condrestart | デーモンが動作しているかを確認後、再起動します。(/var/lock/subsys/sshd が存在するとき再起動します。) |
sshd を起動するには、以下のコマンドを実行します。
# /etc/init.d/sshd start |
sshd を停止するには、以下のコマンドを実行します。
# /etc/init.d/sshd stop |
Turbolinux 11 Server の起動時に sshd を自動的に開始するには、以下のように chkconfig コマンドを実行しておきます。
# chkconfig sshd on |
sshd の設定ファイル /etc/ssh/sshd_config を変更した場合は、変更を反映するために sshd を再起動します。
# /etc/init.d/sshd restart |
また、sshd は、TCP Wrapper ライブラリ利用したアクセス制御を行います。Turbolinux 11 Server の /etc/hosts.allow では、以下のようにすべてのクライアントからのアクセス要求を許可しています。必要に応じてアクセス可能なクライアントを制限してください。
sshd : ALL |
/etc/hosts.allow の編集については、項20.1 を参照してください。