Prev / Next

2013-06-13 / sshd の file descriptor の制限を変更する

serverspec が sshd の file descriptor の制限にひっかかった件([2013-06-13-2])の
対応として、sshd の file descriptor の制限を変更する方法を考える。

一番簡単なのは、/lib/svc/method/sshd の start 部分に ulimit を追加する方法。

'start')
        #
        # If host keys don't exist when the service is started, create
        # them; sysidconfig is not run in every situation (such as on
        # the install media).
        #
        create_key $SSHDIR/ssh_host_rsa_key rsa
        create_key $SSHDIR/ssh_host_dsa_key dsa

        ulimit -n 8192
        /usr/lib/ssh/sshd
        ;;


これはお手軽だけど、パッケージの管理下にあるファイルを変更したくない。

@nsloop 先生によると



ということなので、この辺りを調べてみる。

一時的に変更したければ、


contract 経由で PID を調べることで、目的の sshd のプロセスを特定できるのは便利。

comments powered by Disqus