Mac OSXでSubversion + SSH公開鍵認証の設定

Windowsには、TortoiseSVNという定番のGUIがあるがMacはSCPluginを使えば、同じようにフォルダベースのSVNが利用できます。今回は、サーバCentOS5.1が既にSubversionインストール済み、レポジトリも作成済みという前提で話を進めます。

ちなみにCentOSでSubversionをインストールするには
#yum install subversion
だけで簡単にインストールできます。

1.クライアント(MacOSX)にsubversionのインストール
http://www.collab.net/downloads/community/

2.クライアント(MacOSX)にSCPlugin-0.7.1のインストール
http://scplugin.tigris.org/servlets/ProjectDocumentList
SCPluginをインストールした後、一度Macを再起動します。

3.SSH公開鍵認証の設定

[クライアント(MacOSX)]
$cd /Users/hogehoge/.ssh
$ssh-keygen -t dsa
Enter file in which to save the key (/Users/yuji/.ssh/id_dsa):identity
Enter passphrase (empty for no passphrase): 空のまま
Enter same passphrase again: 空のまま
$scp ./identity.pub hogehoge@xxx.xxx.xxx.xxx:/home/hogehoge/.ssh/id_dsa.pub

[サーバ(CentOS5.1)]
$cd /home/hogehoge/.ssh
$su root
#vi /etc/ssh/sshd_config
PermitRootLogin no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
#RhostsRSAAuthentication no
#PasswordAuthentication yes
$chmod 755 ../.ssh
$touch authorized_keys
$chmod 600 authorized_keys
$cat id_dsa.pub >> authorized_keys
$su root
#/sbin/service sshd restart

これで設定完了。パスワード無しで公開鍵認証するかを確認。

$ssh hogehoge@xxx.xxx.xxx.xxx

これでログインできればOK!!

4.最後はチェックアウトできるか確認します。
クライアント(MacOSX)で任意のフォルダに移動して、右クリック
[その他] > [Subversion] > [Checkout]
を選択して下記のように設定して「Checkout」すれば完了!!

レポジトリURL:svn+ssh://hogehoge@xxx.xxx.xxx.xxx/home/hogehoge/svn/repos/trunk
ユーザ:Anonymous

update : 2008年6月 9日 11:44 PM
続きを読む >

Categories

Apache
セキュリティ
ベーシック認証
c++
XML
文字コード
Linux
時刻
Subversion
mac

latest entries

2008/06/09
Mac OSXでSubversion + SSH公開鍵認証の設定
Windowsには、TortoiseSVNという定番のGUIがあるがMacはSC...

 

Copyright © 2008 hidamari.biz All Rights Reserved.