Creating one "per-user" login script on Ubuntu server
Is it possible to create a bash script that Ubuntu Server will execute every time that a user logs in locally? Is it possible to set up a specific script for each user?
I explain. For the reasons that I explain on this post, I need that users listed on the LDAP tree cannot log into the server machine (please read the post for more details).
Would it be possible to create a bash script for the users that I want to lock out of the server, so that this script would log them out? I mean, a login script that would contain "logout" as the first (and probably the only) order, so that the users from the LDAP tree would pass authentication but then be kicked out more or less immediately.
How can I do that?
Thanks, and regards,
Why don't you give these users a shell such as /usr/sbin/nologin or /bin/false? Then they wouldn'T be able to log in via SSH.
I really would not want to mess something and not be able to log into my server box at all, so, because I have never changed the default shell, could you please indicatme precise instructions for changing the shell on a per-user basis? Or maybe point me somewhere on the internet where I can find those instructions? It is important to remind that the user that I created at install time should be allowed to log in, but just not the others.
I have found a number of posts and web pages talking about such a change on Ubuntu desktops, but not so for servers.
Your idea seems to me like a perfect solution.
Million thanks for your help.
Just edit the /etc/passwd file.
|All times are GMT +2. The time now is 05:54.|
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.