开发者

How to prevent interactive ssh login? [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

Short Question: How do i prevent interactive(human) ssh login on a Linux machine?

The unix accounts should be available only for non-interactive ssh use (like via some other program), for eg: via a GIT client etc...

The idea is to prevent end-users from logging into the Linux machi开发者_运维技巧ne interactively. It is strictly meant to be used via a GIT client program to checkin-checkout files.


Change the user's default shell to git-shell.

chsh -s `which git-shell` <USER>


Another way:

See how Gitolite organize the access to any git command through a forced-command script in ssh, mentioned in authorized_keys.

The Gitolite script gl-auth-command explicitly prevents any interactive session, while allowing git commands.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜