1825009 Members
2807 Online
109678 Solutions
New Discussion юеВ

user profile

 
SOLVED
Go to solution
juno2
Super Advisor

user profile

I have setup a new unix , but the user can't automatically run their own .profile when login , they can run their profile when run the following statement ( $ . ./.profile ) , how to solve it? thx
8 REPLIES 8
Michael Tully
Honored Contributor

Re: user profile

Hi Juno,

How did you create the user ?
What are the permissions of the users .profile file? If the user does not have read permissions you will have a problem.

The users profile runs automtically when logging in. Here is the order.

user logs in
the user picks up /etc/profile, then their own profile. you do not need an type of execute permissions for the profile.

Regards
Michael
Anyone for a Mutiny ?
Ramkumar Devanathan
Honored Contributor
Solution

Re: user profile

Juno,

Which shell is this?
if it is bash, you must be modifying ~/.bash_profile.

for ksh and sh, you'd be done with modifying ~/.profile.

I am assuming that you may have compiled and installed bash on hp-ux, and that a port is readily available. excuse me if these assumptions are wrong.

did you create the user using the useradd command or like a few people i know edited the /etc/passwd file directly. as a general practice i use the useradd command and never edit the /etc/passwd file directly (dirty). i know i will miss out some step in the process if i go the dirty way.

- ramd.
HPE Software Rocks!
juno2
Super Advisor

Re: user profile

Yes, i use bash , thx all help.
V. V. Ravi Kumar_1
Respected Contributor

Re: user profile

hi,
i hope that u might have copied the .profile from some other machine. look for the shell in the .profile and /etc/passwd and change if necessary. also comment the following line
DTSOURCEPROFILE=true
in .dtprofile in the home directory of user.

Regards
Ravi
Never Say No
juno2
Super Advisor

Re: user profile

thx all, one more question, how about other system file, eg. what is the rhosts file on bash , is it /.bash_rhosts ? thx.
T G Manikandan
Honored Contributor

Re: user profile

.rhosts file is not specific to any shell.

It is common to all shells


Thanks
Chia-Wei
Advisor

Re: user profile

I guess adding in DTSOURCEPROFILE=true in .dtprofile will solve the problem.
Bill Hassell
Honored Contributor

Re: user profile

Profiles are always dependent on the shell, so the answer is: man

For the HP-UX POSIX shell and the Korn shell, /etc/profile is run, followed by $HOME/.profile (and for ksh, .kshrc may be setup in the environment. csh uses a different set of files and bash (not standard for HP-UX) use the set of files listed in the man page.

NOTE: All of these profiles are run only when a 'normal' login is performed, ie, a telnet connection or a serial/modem login. If the login is connected to an Xwindow manager, things are not very standard. While CDE can be configured to source a profile, it does not cause /etc/profile to be run. If you use Xwindows, the environment of the login window (ie, hpterm, xterm dtterm) should have the Xwindow resource *loginShell=true so that a 'normal' login will take place.


Bill Hassell, sysadmin