How to prevent interactive ssh login? [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionShort 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.
精彩评论