トップページ » SSH関連 » Solaris10のSSHサービス
カテゴリー
My Yahoo!に追加
Sun社提供情報
Solarisパッケージダウンロード
Sunマシンは買うには
blogs.sun.com
お勧めサイト
プライベートリンク

Solaris10のSSHサービス

Solaris10では以下のようにsshサービスがデフォルトで稼働しています。
(以降の出力はSolaris10 5/09 [update7]環境で取得しています)

# svcs ssh
STATE          STIME    FMRI
online          6月_12  svc:/network/ssh:default

インストール時にどのようなソフトウェアグループを選んでも、Secure By Defaultでリモートサービスを無効にしても、netservices limit コマンドを実行してもsshサービスが無効になることはありません。

安全なリモートアクセス環境を提供する意味では、sshサービスを無効にする必要はないかと思いますが、リモートアクセスを完全に禁止するシステムでは以下のようにサービスを停止することがあるかもしれません。

# svcadm disable ssh
# svcs ssh
STATE          STIME    FMRI
disabled       14:14:26 svc:/network/ssh:default

sshサービスのプロパティー

sshサービスのマニフェストファイルである/var/svc/manifest/network/ssh.xmlや、以下のsvcpropコマンドの出力からプロパティーを確認することができます。

ssh.xmlファイル

# cat /var/svc/manifest/network/ssh.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
        Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
        Use is subject to license terms.

        ident   "@(#)ssh.xml    1.7     04/12/09 SMI"

        NOTE:  This service manifest is not editable; its contents will
        be overwritten by package or patch operations, including
        operating system upgrade.  Make customizations in a different
        file.
-->

<service_bundle type='manifest' name='SUNWsshdr:ssh'>

<service
        name='network/ssh'
        type='service'
        version='1'>

        <create_default_instance enabled='false' />

        <single_instance />

        <dependency name='fs-local'
                grouping='require_all'
                restart_on='none'
                type='service'>
                <service_fmri
                        value='svc:/system/filesystem/local' />
        </dependency>

        <dependency name='fs-autofs'
                grouping='optional_all'
                restart_on='none'
                type='service'>
                <service_fmri value='svc:/system/filesystem/autofs' />
        </dependency>

        <dependency name='net-loopback'
                grouping='require_all'
                restart_on='none'
                type='service'>
                <service_fmri value='svc:/network/loopback' />
        </dependency>

        <dependency name='net-physical'
                grouping='require_all'
                restart_on='none'
                type='service'>
                <service_fmri value='svc:/network/physical' />
        </dependency>

        <dependency name='cryptosvc'
                grouping='require_all'
                restart_on='none'
                type='service'>
                <service_fmri value='svc:/system/cryptosvc' />
        </dependency>

        <dependency name='utmp'
                grouping='require_all'
                restart_on='none'
                type='service'>
                <service_fmri value='svc:/system/utmp' />
        </dependency>

        <dependency name='config_data'
                grouping='require_all'
                restart_on='restart'
                type='path'>
                <service_fmri
                    value='file://localhost/etc/ssh/sshd_config' />
        </dependency>
<!--
上記エントリから/etc/ssh/sshd_configファイルが sshサービスの起動に必要な設定ファイルであることがわかる。
-->

        <dependent
                name='ssh_multi-user-server'
                grouping='optional_all'
                restart_on='none'>
                        <service_fmri
                            value='svc:/milestone/multi-user-server' />
        </dependent>

<!--
上記エントリからsshサービスはmulti-user-serverマイ ルストーンの起動レベルで有効(online)になることがわかる。
-->

        <exec_method
                type='method'
                name='start'
                exec='/lib/svc/method/sshd start'
                timeout_seconds='60'/>

<!--
上記エントリからsshサービスの起動時に /lib/svc/method/sshdスクリプトが実行されることがわかる。
-->

        <exec_method
                type='method'
                name='stop'
                exec=':kill'
                timeout_seconds='60' />

        <exec_method
                type='method'
                name='refresh'
                exec='/lib/svc/method/sshd restart'
                timeout_seconds='60' />

        <property_group name='startd'
                type='framework'>
                <!-- sub-process core dumps shouldn't restart session -->
                <propval name='ignore_error'
                    type='astring' value='core,signal' />
        </property_group>

        <property_group name='general' type='framework'>
                <!-- to start stop sshd -->
                <propval name='action_authorization' type='astring'
                        value='solaris.smf.manage.ssh' />
        </property_group>

        <stability value='Unstable' />

        <template>
                <common_name>
                        <loctext xml:lang='C'>
                        SSH server
                        </loctext>
                </common_name>
                <documentation>
                        <manpage title='sshd' section='1M' manpath='/usr/share/man' />
                </documentation>
        </template>

</service>

</service_bundle>

svcpropコマンド

# svcprop ssh
general/enabled boolean false
general/action_authorization astring solaris.smf.manage.ssh
general/entity_stability astring Unstable
general/single_instance boolean true
fs-local/entities fmri svc:/system/filesystem/local
fs-local/grouping astring require_all
fs-local/restart_on astring none
fs-local/type astring service
fs-autofs/entities fmri svc:/system/filesystem/autofs
fs-autofs/grouping astring optional_all
fs-autofs/restart_on astring none
fs-autofs/type astring service
net-loopback/entities fmri svc:/network/loopback
net-loopback/grouping astring require_all
net-loopback/restart_on astring none
net-loopback/type astring service
net-physical/entities fmri svc:/network/physical
net-physical/grouping astring require_all
net-physical/restart_on astring none
net-physical/type astring service
cryptosvc/entities fmri svc:/system/cryptosvc
cryptosvc/grouping astring require_all
cryptosvc/restart_on astring none
cryptosvc/type astring service
utmp/entities fmri svc:/system/utmp
utmp/grouping astring require_all
utmp/restart_on astring none
utmp/type astring service
config_data/entities fmri file://localhost/etc/ssh/sshd_config (設定ファイル)
config_data/grouping astring require_all
config_data/restart_on astring restart
config_data/type astring path
dependents/ssh_multi-user-server fmri svc:/milestone/multi-user-server
startd/ignore_error astring core,signal
start/exec astring /lib/svc/method/sshd\ start (起動時に実行されるスクリプト)
start/timeout_seconds count 60
start/type astring method
stop/exec astring :kill
stop/timeout_seconds count 60
stop/type astring method
refresh/exec astring /lib/svc/method/sshd\ restart
refresh/timeout_seconds count 60
refresh/type astring method
tm_common_name/C ustring SSH\ server
tm_man_sshd/manpath astring /usr/share/man
tm_man_sshd/section astring 1M
tm_man_sshd/title astring sshd
restarter/start_pid count 28363
restarter/start_method_timestamp time 1244779685.048924000
restarter/start_method_waitstatus integer 0
restarter/logfile astring /var/svc/log/network-ssh:default.log
restarter/contract count
restarter/auxiliary_state astring none
restarter/next_state astring none
restarter/state astring disabled
restarter/state_timestamp time 1246425266.467035000
restarter_actions/refresh integer

SSH関連のその他のリンク

Solaris系技術トレーニング一覧

Solaris10システム管理基本コース
Solaris10ネットワーク・インターネットサーバー管理コース
セキュリティ・パフォーマンス管理・トラブルシューティング等
Sun Cluster、ボリューム管理ソフトウェア
仮想化技術全般
シンクライアント、SunRay、デスクトップソフトウェア
アイデンティティマネージメントサービス
アプリケーションサーバーとWebポータル
サーバー(ハードウェア)メンテナンス
Sun Java CAPS
MySQL