2010-12-07 182 views
4

我正在研究一個我們需要使用SSH集成的iPhone應用程序。我有演示,可以連接服務器與密碼,但我無法得到如何使用公鑰連接。通過使用公鑰的SSH連接到服務器

我可以使用下面的命令通過MAC終端連接它。

SSH -i(KeyFilePath)用戶名@(域名或IP)

但不幸的是,我無法使用Xcode的連接。

感謝,

回答

0

你可能要考慮:首先將私有密鑰(或鑰匙)的認證代理。從這點上,所有的SSH命令將重新使用緩存的關鍵:

# Add a new key to the authentication agent 
$ ssh-add <path to private key> 

# List current keys 
$ ssh-add -l 

# Delete all loaded keys 
$ ssh-add -D 

# Add a new key and store the passphrase in your keychain 
$ ssh-add -K <path to private key1> 
$ ssh-add -K <path to private key2> 

# After storing the private keys passphrase in the keychain, 
# you can load them all, at any time 
$ ssh-add -k 

當認證代理已加載私鑰,你應該能夠使用Xcode的連接(域名或IP)與沒問題。