アカウントを作るだけ、とも言う。
導入方法はBootcampで詳しく解説されているのでその手順通り進める。
1.では、Windows用のクライアントをダウンロードしてインストールし、初期段階のセットアップをするところまでが解説されている。が、実際にやってみるとなんだか解説と違う。
Next: Set Up SSH Keys の手順3で、以下の結果が得られるように書いてあるが、自分の環境では fingerprint までは表示されるが、RSA 2048 という randomart image が表示されない。
Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.
Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db user_name@username.com
The key's randomart image is:
+--[ RSA 2048]----+
| .+ + |
| = o O . |
| = * * |
| o = + |
| o S . |
| o o = |
| o . E |
| |
| |
+-----------------+
まぁいいかと思って先に進めてみると、解説ではすんなりいっているのに、自分の環境では何かにつけて passphrase の入力が求められる。 passphrase として、それなりに面倒な文章をきっちりと入れてしまったので、やな感じ。Why do passphrases matter? というところのコラムで、Mac OSX Leopard 以降ならssh-agentが動いていて、passphrase を覚えてくれるから何度も入力したりしなくて済むよ!とか書いてある。えー。
そこにあるリンクから Working with SSH key passphrases というヘルプページに飛んでみる。
見ていくと、Auto-launching ssh-agent on msysgit というところに、ssh-agent の自動起動のやり方が書いてある。あんじゃん!てか元々Windows用のセットアップページなんだから、これを最初のページに書いておかないで"Macだと自動だけどね"とかドヤ顔されても困るわ!ん?俺が無知?ええ、そうですね。
SSH_ENV="$HOME/.ssh/environment"
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV"
echo succeeded
chmod 600 "$SSH_ENV"
. "$SSH_ENV" > /dev/null
ssh-add
}
# test for identities
function test_identities {
# test whether standard identities have been added to the agent already
ssh-add -l | grep "The agent has no identities" > /dev/null
if [ $? -eq 0 ]; then
ssh-add
# $SSH_AUTH_SOCK broken so we start a new proper agent
if [ $? -eq 2 ];then
start_agent
fi
fi
}
# check for running ssh-agent with proper $SSH_AGENT_PID
if [ -n "$SSH_AGENT_PID" ]; then
ps -ef | grep "$SSH_AGENT_PID" | grep ssh-agent > /dev/null
if [ $? -eq 0 ]; then
test_identities
fi
# if $SSH_AGENT_PID is not properly set, we might be able to load one from
# $SSH_ENV
else
if [ -f "$SSH_ENV" ]; then
. "$SSH_ENV" > /dev/null
fi
ps -ef | grep "$SSH_AGENT_PID" | grep ssh-agent > /dev/null
if [ $? -eq 0 ]; then
test_identities
else
start_agent
fi
fi
.bashrc にまるっとコピペして、bashを立ち上げ直す。すると最初に passphrase を聞いてくる。
Welcome to Git (version 1.7.4-preview20110204)
Run 'git help git' to display the help index.
Run 'git help ' to display help for specific commands.
Enter passphrase for /Home/.ssh/id_rsa:
ここで入力しなきゃいけないのに変わりはないのね、当たり前だけど。入力すると、
Identity added: /Home/.ssh/id_rsa (/Home/.ssh/id_rsa)
OKぽいかな?試しに github に ssh してみると
$ ssh git@githum.com
ssh: connect to host githum.com port 22: Bad file number
繋がらんし。でもこれは何度もやってると繋がったり繋がらなかったりする。鯖の問題?
$ ssh git@github.com
Hi segu! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
ちなみに、-v 付きでデバッグ実行すると繋がりやすい。たまたまかもしれないけど、一度 -v でうまくいくと、それ以降は問題ない感じ。
$ ssh -v git@github.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /Home/.ssh/config
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
...
Hi segu! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Connection to github.com closed.
debug1: Transferred: stdin 0, stdout 0, stderr 34 bytes in 0.4 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 81.9
debug1: Exit status 1
鯖の問題・・・でいいんだよね?分からん。
0 件のコメント:
コメントを投稿