what is the use of each login related files present in users home directory


 
Thread Tools Search this Thread
Operating Systems Solaris what is the use of each login related files present in users home directory
# 1  
Old 06-21-2011
what is the use of each login related files present in users home directory

Code:
# ls -l
total 10
-rw-r--r--   1 dummy2   other        140 Jun 19 21:37 local.cshrc
-rw-r--r--   1 dummy2   other        136 Jun 19 21:37 local.cshrc~
-rw-r--r--   1 dummy2   other        157 Jun 19 21:37 local.login
-rw-r--r--   1 dummy2   other        178 Jun 19 21:37 local.profile
-rw-r--r--   1 dummy2   other        174 Jun 19 21:37 local.profile~
# pwd
/usr/users/dummy2
#

i know .profile is loaded automatically when user logs into his account. what is the user of the remaining files that i have mentioned. i tried to remove all the files. and then logged in back . i saw all files gone but .profile file was automatically created..

My doubt

1. what is the use of each file mentioned above? do we really need it?
2. How the .profile file is created automatically?

Last edited by pludi; 06-21-2011 at 06:59 PM..
# 2  
Old 06-21-2011
Strictly speaking none of these are really needed I think,though they may include useful defaults. They don't look like the normal ~/.profile files and so forth that get loaded by ksh or what have you, but remember, shell profiles are scripts -- they can instruct your shell to run commands, including creating files and sourcing things your shell wouldn't otherwise do by default. I think that, either on login or logout, one of your global profile scripts is copying them in from defaults somewhere.

The .cshrc and .login are for csh, the c-shell, which has a very different syntax from the bourne shell hence can't use the same login scripts. It also has its own equivalent of /etc/profile somewhere, though its exact name depends on your variety of csh.

The ~ files look like backups. cp makes files like that when you do cp -b source destination when destination already exists, the old file will be renamed to destination~ and the new one put in its place.

Last edited by Corona688; 06-21-2011 at 02:53 PM..
# 3  
Old 06-21-2011
1.so even though i deleted my .profile file from where it is getting created automatically?

2. If we create some user and later change his home directory to some other directory.. here in my case i changed user home dir to a mount point.. still his login works .. how??? when user tries to login he would intially land up into his home dir and the .profile file present in home dir would be loaded right? but when i change home dir .profile would be present in the old location only. so if edit the old location would i feel the difference in new location. if yes please let me know how.

Code:
my old location : /home/dummy2       my new location : /newpartition

# 4  
Old 06-21-2011
local.cshrc, local.login, local.profile are template files which are copied to new user's home directory.
This User Gave Thanks to fpmurphy For This Post:
# 5  
Old 06-22-2011
Quote:
Originally Posted by chidori
1.so even though i deleted my .profile file from where it is getting created automatically?
Quote:
Originally Posted by Corona688
remember, shell profiles are scripts -- they can instruct your shell to run commands, including creating files and sourcing things your shell wouldn't otherwise do by default. I think that, either on login or logout, one of your global profile scripts is copying them in from defaults somewhere.
It would be one of the global config files, I'm thinking, perhaps /etc/profile or something it includes. See the manual page for your shells for details on what global and local files they use.
Quote:
2. If we create some user and later change his home directory to some other directory.. here in my case i changed user home dir to a mount point.. still his login works.. how???
Quote:
Originally Posted by Corona688
Strictly speaking none of these are really needed I think,though they may include useful defaults.
Quote:
...when user tries to login he would intially land up into his home dir and the .profile file present in home dir would be loaded right? but when i change home dir .profile would be present in the old location only. so if edit the old location would i feel the difference in new location. if yes please let me know how.
There's no magic communication between old location and new, no. But since, as you noticed, it can create new script files when it wants, that's hardly a problem.
This User Gave Thanks to Corona688 For This Post:
# 6  
Old 06-22-2011
I think even you delete the .profile file there is /etc/profile for all users on the system , the system first look at user .profile to see if there is any settings, if not he will look at /etc/profile , if no setting it will load without any problems .
This User Gave Thanks to hard_revenge For This Post:
# 7  
Old 06-22-2011
Thanks as always guys..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Permissions on a directory in /home for all users

Hi, I have created a shared directory on /home, where all users on a certain group have read, write and execute permissions. I did this using chmod -R g+rwx /home/shared/ The problem is, when a particular user creates a directory within /home/shared, other users are not able to write to... (8 Replies)
Discussion started by: lost.identity
8 Replies

2. Shell Programming and Scripting

Get Home Directory for Users in Login Hook Script

I'm writing a script to use as a LoginHook for my Mac users. As part of this script, I need to write to a location in their home directory, but I can't seem to access the path - at this point in the login process, $HOME is empty and ~ gives the path to root's home. Unfortunately, I can't just do... (1 Reply)
Discussion started by: blondepianist
1 Replies

3. Red Hat

SSH lock users to the Home Directory

Hi friends, I must to give ssh connection to own customer. So I want to lock ssh user on own home directory. It is not necessery to reach other folders. I know that ftp user can lock on own folder but I don't know how to lock ssh user. I am waitting your kindly helps :D ---------- Post... (10 Replies)
Discussion started by: getrue
10 Replies

4. Shell Programming and Scripting

users who have un-sanctioned(forbidden) files in their home directory.

Hello guys, I have to create a sh script which return users who have un-sanctioned(forbidden) files in their home directory. I tried to do: #!/bin/sh -x SHADOW_FILE="/etc/shadow" PASSWORD_FILE="/etc/passwd" for i in `grep -v '^+' $PASSWORD_FILE | cut -d: -f1,6` do username=`echo... (6 Replies)
Discussion started by: catalint
6 Replies

5. UNIX for Advanced & Expert Users

about the access permission of users home directory

RHEL5.0 As we know, when root create a new user, a new home directory will be created : /home/user I want to know what determine the access permission of /home/user . Thanks! (1 Reply)
Discussion started by: cqlouis
1 Replies

6. Solaris

Common Home directory for different users??

Hi Guys, I have a problem with configuring a server. this is a solaris 10 with sparc platform. I have setup so that the server is Authenticating through NIS but I dont want the server to Mount the Home directories. The users need to logged in through the CDE/display. I have over 200 users... (2 Replies)
Discussion started by: Luky
2 Replies

7. Solaris

find home directory paths for all users

How to find al the user's home directories? (2 Replies)
Discussion started by: a2156z
2 Replies

8. UNIX for Dummies Questions & Answers

lost /home/directory for users

I'm using HPUX 11i. The other day a user logon to the workstation and was not able to find the /home/directory (tom is the directory) I login myself and it is the same thing. The home directory is on the server, so I was thinking of using sam to map it again. does anyone know how to do it... (5 Replies)
Discussion started by: blizzgamer
5 Replies

9. UNIX for Dummies Questions & Answers

Home Directory Jail for Users

Hi, I am looking for a shell script (or any other way), that puts a user in a home directory jail. So for example, I have a user named richard and I don't want him wandering outside /usr/users/richard. I don't want him to cd to anywhere including cd .. Somebody said you can do that with... (3 Replies)
Discussion started by: mz043
3 Replies

10. UNIX for Dummies Questions & Answers

Profiles for users without home directory

Hi I want to know which profile will be called when a user without home directory is created. When I created a user without home directory(by setting in /etc/default/useradd), the user is able to login directly into the main "/" folder but with only read permissions. Thanks naina (3 Replies)
Discussion started by: naina
3 Replies
Login or Register to Ask a Question