Discussion Locked

Linux login scripts

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

in redhat 9 where do i put the login script so it will apply to all users when the login? i tried teh .login but that didn't work for some reason.

thanks,

2 replies

by cpfeiffe

Depends on the user shell. For bash/sh/ksh it would be /etc/profile. For csh it would be /etc/login.csh. Other variations also exist.

by paulo.sedrez

In RedHat 6/7/8/9, you can use the /etc/profile.d directory to include login scripts that apply to all (be carefull, aplies to root to). Choose a basename (e.g., "my-login") and create two files (my-login.csh and my-login.sh) with the commands, being the first for csh/tcsh and the second for sh/bash/ksh.

This discussion is closed to new replies.