Craig Sharp
asked on
Unix /etc/profile confirming existance of home directory
Simple question. I need to confirm that a home directory exists when a user logs into Solaris and Linux boxes. If no home, no access. Ideas? I was going to use the /etc/profile. Any examples?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect, thanks! I was in brain lock lol.
ASKER
Tom,
I just saw your comments. Thank you. Yes we are converting to LDAP, but our only concern based on how our systems are setup is to prevent the developers to login to a command line.
I just saw your comments. Thank you. Yes we are converting to LDAP, but our only concern based on how our systems are setup is to prevent the developers to login to a command line.
The accepted solution as listed above is not secure, if your intention is to prevent a user from logging into the system if that person does not have a home directory. By the time the shell is executing and the /etc/profile script is being run, the tty stream is set up and accepting data from the controlling terminal. Is the terminal sends an interrupt signal, the execution will be interrupted and the user will be logged in anyway.
On Solaris, the right way to do this is to use a PAM module. Linux supports PAM as well, so it is probably the right thing on Linux as well.
On Solaris, the right way to do this is to use a PAM module. Linux supports PAM as well, so it is probably the right thing on Linux as well.
If they (s)ftp into the box for example, it may not run /etc/profile
If they ssh with a command parm (ssh {hostname} ls) it may not run /etc/profile
Are you converting to LDAP?
Tom