我想通过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