我想通過ssh從一個用戶/客戶端組合(例如,[email protected]
)訪問用戶/服務器組合(例如,[email protected]
),其中兩個不同類型的訪問:從給定用戶1 /客戶端到同一用戶2 /服務器的多個ssh訪問類型
訪問類型#1將被限制爲與bazaar存儲庫的交互。 對於這一點,我在
~user2/.ssh/authorized_keys
添加了一行(#1)像command="bzr serve --inet --directory=/repodir --allow-writes",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-rsa ... [email protected]
訪問類型#2將是一個登錄shell。 對於這一點,我在
~user2/.ssh/authorized_keys
添加了一個「通常」的線路(#2)一樣ssh-rsa ... [email protected]
據我所知,並且如我測試,這兩條線不能被同時使用。 也就是說,如果線#1中首先出現~user2/.ssh/authorized_keys
,那麼我將能夠與BZR回購互動,但我不能做
[[email protected]]$ ssh [email protected]
如果線#2首先出現在~user2/.ssh/authorized_keys
,然後我就能夠做到ssh
,但任何bzr
操作給
bzr: ERROR: Not a branch ...
有沒有什麼辦法來解決這一問題?
我使用的是RHEL7,但我想這不重要。
相關職位(但沒有解決我的情況,我的理解):
Best way to use multiple SSH private keys on one client
https://serverfault.com/questions/142997/what-options-can-be-put-into-a-ssh-authorized-keys-file
https://serverfault.com/questions/749474/ssh-authorized-keys-command-option-multiple-commands
https://askubuntu.com/questions/1962/how-can-multiple-private-keys-be-used-with-ssh