#pragma section-numbers off [[TableOfContents]] = 概要 = = URL = = インストール = = 設定 = == sshdの設定 == ||変数||設定||説明|| ||Protocol||2||SSH-2のみを許可|| ||PermitRootLogin||no||rootでのログインを拒否|| ||PasswordAuthentication||no||ユーザパスワードでのログインを拒否|| ||RhostsAuthentication||no||.rhostでの認証を拒否|| ||RhostsRSAAuthentication||no||.rhostでのRSA認証を拒否|| ||PermitEmptyPasswords||no||空パスワードを拒否|| ||ListenAddress||127.0.0.1||で接続を許可するホスト指定|| ListenAddressは複数指定可能。localhostのアドレスも入れる事。 == SSH初期設定 == {{{ $HOME/.ssh/config /etc/ssh/ssh_config }}} いずれかのファイルに記述する。 書式は http://www.unixuser.org/~euske/doc/openssh/jman/ssh_config.html 参照 = 利用方法 = == key作成 == rsa で鍵を生成するなら 2048 とかで生成することをお勧めします。そもそも rsa で生成する場合何も指定しないと 2048 です。 ネットのサンプルに 1024 のサンプルが多いように見えますが情報が古いです。 {{{ ssh-keygen -b 2048 -t rsa }}} pub keyをホストに転送。この時はFTPでもよいだろう。 {{{ cd ~/.ssh touch authorized_keys chmod 600 authorized_keys cat id_rsa.pub >> authorized_keys }}} == 接続 == {{{ slogin host sftp host など、、 }}} == パスフレーズの省略 == {{{ eval `ssh-agent` ssh-add }}} * Windows [https://github.com/ganaware/win-ssh-agent ganaware/win-ssh-agent - GitHub] = Tips = == バージョン番号隠蔽 == [http://search.luky.org/linux-users.9/msg00730.html linux-users:90725 sshd のバージョン番号を知られたくない] 100害あって1利なしなのでやらないように。 == sf.jpで開発する場合 == configの設定に注意しないとログインできない。 {{{ StrictHostKeyChecking ask IdentityFile ~/.ssh/identity Port 22 Protocol 1,2 }}} を設定しておく必要がある。 export CVS_RSH=ssh == SSH_ASKPASSが必要とされる == DISPLAY環境変数が設定されているとなる場合がある。 http://www.codefab.com/unsupported/ の{{{SSHPassKey}}}を利用する手もある。 {{{ SSH_ASKPASS=/Applications/Utilities/SSHPassKey.app/Contents/MacOS/SSHPassKey }}} = 周辺プログラム = [http://rsug.itd.umich.edu/software/fugu/ Fugu - A Mac OS X SFTP, SCP and SSH Frontend] [http://www.phil.uu.nl/%7Exges/ssh/ SSH Agent graphical front-end] [http://www.gentoo.org/proj/en/keychain/index.xml Gentoo Linux Documentation -- Keychain] = Webベース = http://phpterm.sourceforge.net/ = 参考サイト = [http://www.unixuser.org/~euske/doc/openssh/jman/ OpenSSH 日本語マニュアルページ] [http://www.unixuser.org/~haruyama/security/openssh/ OpenSSH 情報] [http://www.netlab.is.tsukuba.ac.jp/~one/ssh/ SSHってかんたんなのね] [http://www.unixuser.org/~haruyama/security/openssh/support/ OpenSSH セキュリティ管理ガイド サポートページ] [http://member.nifty.ne.jp/hardy/linux/install/sshd.html SSHdの設定] [http://www.jp.redhat.com/manual/Doc73/RH-DOCS/rhl-rg-ja/s1-ssh-configfiles.html OpenSSHの設定ファイル] [http://www-komo.ise.eng.osaka-u.ac.jp/~kaneta/unix/ssh3.html SSHサーバの設定] [http://home.opaopa.org/solaris9/ssh.html SSH の鍵管理] ---- CategorySecurity