Requirement:
Allow SSH but disallow SFTP to a particular user group. Once disallowed, if the user group tries to access SFTP, it should not be allowed and all connections should be closed and the user should get the prompt back.
Current situation:
I'm able to disallow a particular user group using a Match
block and Forcecommand
.
But not able to get the prompt back once login fails.
Example:
abcd> sftp [email protected] [Does not allow but it remains in a hang state]
Need to press Ctlr C to get back the prompt (abcd>)
Expectation:
abcd> sftp [email protected] [Fails next line prompt should be back]
abcd>
I want to know if it is possible, if yes share your inputs.
# ssh [email protected] 'cat /etc/passwd' > ~/passwd.remote.host
sftp
but disallow a shell. The other way around does not really make sense to me.