Hostname lost when changing user


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Hostname lost when changing user
# 1  
Old 01-31-2006
Hostname lost when changing user

Hello to all,
Does anyone have a clue for the following problem?

When I enter into a terminal console window logged as axadmin user, what I find in the prompt is: “axadmin@sunhost$”.

But, when I switch to root user, with the command “su -“ and enter the correct password, user root is accepted, but the prompt changes to “-s#”.
So, no mention to the user name and hostname, because the expected prompt should be “root@sunhost#”.

This error also happens if I'm axadmin user and I try to log again as axadmin, with command “su - axadmin”. In that case, the prompt becomes “-s$”.

To correct the problem I have to use the command “/bin/uname -S sunhost”.

Has someone experienced this problem before?

Cheers!
Pablo.
# 2  
Old 01-31-2006
You need to look at startup script for root. It must have a bug. It would usually be /.profile but could vary based on root's shell.
# 3  
Old 01-31-2006
Hostname issue

Thanks!
Actually I had verified /.profile before. Nothing seems really wrong there.
I believe something is wrong with ./dtprofile file (which refers to /etc/kshrc) for root user and main application administrator.
We have detected that /bin/uname -n shows the wrong hostname when the problem happens. So we believe that other process is attributing a wrong value to the environment variable.
If anybody knows another hint, please reply.
Tks!
Pablo.
# 4  
Old 01-31-2006
Modify root's .profile for a while. Add "uname -a" as the first line and the last line. Then try su'ing to root. Do the two outputs agree?
# 5  
Old 01-31-2006
Hostname issue

Man, you are a genius!

By giving this clue, of putting a temporary flag, I could detect the exact line which was bringing the problem.

The doc profile is cleared, but after placing some of these flags inside /etc/khsrc I could find the line and the wrong variable. Now I have changed it and it's ok now.

Thank you very much!
Pablo.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I know my user@hostname ?

(8 Replies)
Discussion started by: wojeezy
8 Replies

2. Solaris

New user: lost application manager

Dear all, I am a beginner with Solaris. I unfortunately remove the Application Manager from the Front Panel, and I really don't know how to put it again, or from where launch it... Could anyone help me? (1 Reply)
Discussion started by: avr
1 Replies

3. Solaris

SVM - Metadevices are offline after changing hostname solaris x86

Hi , We are facing an issue on one of our solaris x86 server, After changing the hostname and a orderly reboot , all metadevices shows offline. please let us know the steps to restore back all metadevices to working state with this new hostname (3 Replies)
Discussion started by: karthick.sh
3 Replies

4. Solaris

changing hostname on Solaris 8 ?

hi, does anyone had experience changing hostname on Solaris 8 ? any idea how is it done ? (4 Replies)
Discussion started by: Exposure
4 Replies

5. UNIX for Dummies Questions & Answers

Changing IP & hostname

I have to do this twice. First, A) change IP address, subnet & default gateway. then a few days later B) change IP address again (same subnet & gateway) & hostname. (why twice? To get the vlan stuff out of the way in advance) what is the best way to do A? can all be done through... (5 Replies)
Discussion started by: LisaS
5 Replies

6. Solaris

changing ip and hostname on solaris

dears does any one know in steps how can i change ip and hostname on solaris (10 Replies)
Discussion started by: murad.jaber
10 Replies

7. UNIX for Advanced & Expert Users

How to stop DHCP from changing hostname

Hi, greetings. I have installed OS 10 on sunfire 240. FOr now let dhcp to give IP address but it keeps chaning hostname. How do I stop this? thanks Jaya (3 Replies)
Discussion started by: vr76413
3 Replies

8. HP-UX

lost standart input after su - <user>

All, hope somebody can help here: wrote a small shell script running under root on //usr/bin/ksh no specialisties in the profile. Then the test script: ------------------------------------------- echo "Now we start, press any key..." read su - test -c "id | wc -l" 2>/tmp/x echo... (0 Replies)
Discussion started by: tamo2000
0 Replies

9. UNIX for Dummies Questions & Answers

what happen when changing Hostname?

I 'm using RH 7.2 Genome in the Network Configuration I change therer are two places one for static hostname for my machine and in DNS hostname I don't know what happen when restarting my PC when connecting using dialer I can't browse the Internet also I can't use sendmail .......Server timeout... (2 Replies)
Discussion started by: atiato
2 Replies
Login or Register to Ask a Question