i want to limit the ssh tunneling per user I did create a user with only ssh tunneling permission ( no shell, no directory ) now I want to limit this user not be able to connect multi devices simultaneously to this tunnel ( I don't want to bind device's mac address to the user since they might change their device or firewall things ). does changing the user maxlogin on /etc/security/limits affect ssh tunneling limits?
1 Answer
Yes, it does, example below.
The post How can I disconnect ssh users, or limit the number of ssh logins? has this in an answer by Dmitry Alexeyev:
Setting up maxlogins limit actually works here. Just make sure you use '-' limit type, not 'hard'.
user1 - maxlogins 1
Note that the post demanded a method for preventing more than one user
to connect to the tunnel at a time, and the answer was
by setting maxlogins
to 1
for both users.