LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   login as oracle user but prompt show [root@ablnx oracle] how come? (https://www.linuxquestions.org/questions/linux-newbie-8/login-as-oracle-user-but-prompt-show-%5Broot%40ablnx-oracle%5D-how-come-664275/)

sathyguy 08-21-2008 03:50 AM

login as oracle user but prompt show [root@ablnx oracle] how come?
 
Friends,

RHEL AS 3
when ever i log in as oracle user. the prompt is showing [root@ablnx oracle] how the oracle user is changing in to root?
how can i make the prompt to display [oracle@ablnx oracle]?

thanks

colucix 08-21-2008 03:59 AM

First the silly question: are you sure you logged as oracle user? Try
Code:

who am i
hiding the IP address, if you're going to post the output here. Then, what is the value of the environment variable PS1?

sathyguy 08-21-2008 04:07 AM

thanks for your reply.

when i type
[root@ablnx oracle]# who am i
oracle tty1 Aug 21 10:39

when i type
[root@ablnx oracle]# whoami
root

how/where to see the environment variable ps1?

sathyguy 08-21-2008 04:34 AM

ok....here .... the ps1 values
echo $PS1
[\u@\h \W]\$

colucix 08-21-2008 04:35 AM

Quote:

Originally Posted by sathyguy (Post 3254619)
how/where to see the environment variable ps1?

Just do
Code:

echo $PS1
you will see a string containing some modifiers like \u \h and so on. Depending on the value of this variable, the command prompt will be dinamically updated every time you change user and/or directory. For example on a RHEL4 installation I have:
Code:

[\u@\h \W]\$
this tell to build the prompt using: open square bracket, username, @, hostname, current directory without absolute path, closed square bracket and a litteral $.

Regarding the different output of the "who am i" commands, take in mind that whoami is the same as id -un, whereas who am i is the command who with two special arguments. The different output can be related to the way you logged in as user oracle. What is it?

For example, by using the su command you retain the id of the original user and whoami acts accordingly.

colucix 08-21-2008 04:37 AM

Quote:

Originally Posted by sathyguy (Post 3254640)
ok....here .... the ps1 values
echo $PS1
[\u@\h \W]\$

Ok. Good. It looks right. How do you log as user oracle?

sathyguy 08-21-2008 04:42 AM

i have set id:3:initdefault for full multiuser mode.
ablnx login: oracle
password: password

thats it....am i right?

colucix 08-21-2008 04:55 AM

It looks right. Sincerely I am almost lost, here. Just a last question: what is the output of
Code:

id
once you've logged in as oracle? And how the user oracle has been created?

sathyguy 08-21-2008 05:02 AM

[root@ablnx oracle]# id
uid=0(root) gid=0(root) groups=0(root)

"how the user oracle has been created?"
Actually i didnt create this user.....the admin who was here before.....created this oracle user. now i am using this one.

colucix 08-21-2008 05:24 AM

This tells you that oracle is actually root. Like an alias for the username. I don't know how it is possible, but you have to investigate the user accounts and try to understand what's going on. And expecially if there is a reason for that.

Valery Reznic 08-22-2008 02:56 AM

Quote:

Originally Posted by colucix (Post 3254686)
This tells you that oracle is actually root. Like an alias for the username. I don't know how it is possible, but you have to investigate the user accounts and try to understand what's going on. And expecially if there is a reason for that.

Look in the /etc/passwd. It's likely that for some reason uid for oracle user specified to be 0.
IMHO it should be changed to something reasonable

sathyguy 08-23-2008 02:07 AM

yes.....i think....by seeing this output you can help me...

below is the output of my production server

[root@ablnx oracle]# cat /etc/passwd
oracle:x:501:501::/home/oracle:/bin/bash

here is the output of my test server (this is my problem)
[root@ablnx oracle]# cat /etc/passwd
oracle:x:0:0::/home/oracle:/bin/bash

what to do now?

colucix 08-23-2008 02:52 AM

First be sure you have a valid root account. Then you can try the command usermod to modify the UID and the GID of the user oracle. Or eventually you can delete it and create it again with the proper UID and GID. Be careful to not delete its home directory. After that, most likely you have to change the ownership of some files and directories, using chown as root.


All times are GMT -5. The time now is 06:36 PM.