WWW サーバ
O R A N G E

ssh
■ メモ
  • 2003 年度よりセキュリティの高い ssh2 をデフォルトで使用する.
    だたし, ssh1 のサポートも従来通り行う(mac, win のソフトが揃っていないため).
  • ssh1,2 ともに nonpasslogin を可能にする. これは gate-toruku-system のみならず グループユーザにおける自動データ転送等に用いられる.
  • ssh における x 転送を許可する.
■ X 転送許可
  • sshd の設定ファイルを以下のように変更する
    # vi /etc/ssh/sshd_config

    ---------------
    X11Forwarding yes
    ---------------
■ nonpasslogin 設定 (ssh する場合)
  1. /usr/bin/ssh, /usr/bin/ssh-keygen の s ビットが立っているか確認する.
    $ ls -l /usr/bin/ssh /usr/bin/ssh-keygen

    -rwsr-xr-x 1 root root 230248 Jul 12 19:52 /usr/bin/ssh
    -rwsr-xr-x 1 root root 151496 Jun 20 01:23 /usr/bin/ssh-keygen
    たっていない場合はパーミッションを変更する.
    # chmod 4755 /usr/bin/ssh /usr/lib/ssh-keygen

  2. ssh の設定ファイルの以下の二項目を設定する(設定項目が存在しない場合は新たに追加する).
    # vi /etc/ssh/ssh_config

    ---------------
    HostbasedAuthentication yes
    PreferredAuthentications hostbased,publickey,password
    ---------------
■ nonpasslogin 設定 (ssh される場合)
  1. sshd の設定ファイルを以下のように変更する
    # vi /etc/ssh/sshd_config

    ---------------
    # Don't read the user's ~/.rhosts and ~/.shosts files
    IgnoreRhosts no
    # For this to work you will also need host keys in /etc/ssh_known_hosts
    RhostsRSAAuthentication yes
    # similar for protocol version 2
    HostbasedAuthentication yes
    # Change to yes to enable tunnelled clear text passwords
    PasswordAuthentication yes
    ---------------
  2. 再起動
    # /etc/init.d/ssh restart
■ nonpasslogin のテスト(ユーザレベルでの設定)

今回の場合, sango -> sango の nonpasslogin が行えればよい.
(別サーバへのテストを行う場合は, こちらを参照のこと)

  1. ユーザレベルでの許可設定のファイルを作成
    mondo3@sango$ echo "sango.ep.sci.hokudai.ac.jp mondo3" > ~mondo3/.shosts
    mondo3@sango$ chmod 600 ~mondo3/.shosts
  2. ssh コマンドを実行
    mondo3@sango$ ssh sango.ep.sci.hokudai.ac.jp

    The authenticity of host 'sango.ep.sci.hokudai.ac.jp (133.50.160.53)' can't be established.
    RSA key fingerprint is ##:##:##:##:##:##:##:##:##:##:##:##:##:##:##:##.
    Are you sure you want to continue connecting (yes/no)? yes

    mondo3@sango$
    上記の通り, パスワードを聞かれずに login が成功したら OK.
Copyright © 2008 EPnetFaN
最終更新日:2009/10/08 (柳 芳紀)