Run a script post login linux
10,577
Assuming all your users are using bash, then the file /etc/profile
is executed on login. On some distros there is an /etc/profile.d
. You could drop your login script into this directory.
Related videos on Youtube
Author by
RealWorld
Updated on September 18, 2022Comments
-
RealWorld almost 2 years
I would like to run a script after a linux user logs in to do some additional security checks. The user should first login normally using their password, but then be checked with my script, and then get full access to the system. Is this possible?
-
Zoredache almost 10 yearsAre you sure you really want to have it happen post-login? With PAM you can do a lot of checking.
-