Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
As the title says I want each user to be able to login only once by using ssh. If he/she is already logged in then he/she shouldn't be able to login again.
Is there an entry for this in sshd_config or do I need to do it with iptables?
Is there an entry for this in sshd_config or do I need to do it with iptables?
I don't think there is a parameter in sshd_config, and frankly, I don't know how you would do it with iptables. (If you can clue me in, I'm all ears! )
If the login shell for all of your users is bash, then you could edit /etc/profile so that if a user is already logged in, it immediately dumps them back out. (Make sure it's not the current login you are seeing!) I am not sure how to check that the existing login is via ssh, but there is probably a way.
I don't think there is a parameter in sshd_config, and frankly, I don't know how you would do it with iptables. (If you can clue me in, I'm all ears! )
The only way with iptables I can think of is by blocking two connections on port 22, or whatever else port sshd may listening to, but this wouldn't allow another user from the same IP to login with a different account.
Quote:
Originally Posted by blackhole54
If the login shell for all of your users is bash, then you could edit /etc/profile so that if a user is already logged in, it immediately dumps them back out. (Make sure it's not the current login you are seeing!) I am not sure how to check that the existing login is via ssh, but there is probably a way.
Hm... I wasn't aware of that. Will try to find something out.
Quote:
Originally Posted by ramram29
You can do it through pam.
I haven't used pam before to be honest. It would be a good opportunity to do it now but then I think that it'll get more complex than what I was excepting to do. Thanks anyway
The only way you'll be able to specify connection limits is through pam. It's weird to understand at first but once you get it then it'll stick in your brain forever.
The only way you'll be able to specify connection limits is through pam. It's weird to understand at first but once you get it then it'll stick in your brain forever.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.