Cannot su to a user in AIX

Hi All,

We are facing the below issue when we try to SU to a user in AIX

0:root@dehensv215:/var/adm # su - orac38
foreach: Words not ()'ed.
% pwd
/oracle/C38
% ls

We are able to login to other admin user in the same server only problem is with this user orac38.

Guess some problem with environmental variables,

We are not able to login to this user and we are facing problems because of this issue.

Please help and provide your suggestions in this regard.

Thanks,
Vijay

Hi,
Try

su orac38

Maybe something is wrong with orac38 profile
Regards

Hi,

I tried and got the below

0:root@dehensv215:/oracle/C38 # su orac38
%

This time it didn't pop up the error but still its showing % symbol after login

please let us know were we can chk the profiles.

Thanks

Hi,
You have a .cshrc file: what's the content?
Regards

Hi ,

Please find below the content of .cshrc file under location /oracle/C38

0:root@dehensv215:/oracle/C38 # cat .cshrc
# @(#) $Id: //bc/701-1_REL/src/ins/SAPINST/impl/tpls/ind/ind/SAPSRC.CSH#1 $ SAP
# necessary to get hostname without domain (AIX, OS/390 and NOT sun)
switch (`uname`)
   case AIX*:
       alias hostname 'hostname -s'
   breaksw
   case OS/390*:
       setenv _BPXK_AUTOCVT ON
       setenv _TAG_REDIR_IN TXT
       set    _TAG_REDIR_IN=TXT
       setenv _TAG_REDIR_OUT TXT
       set    _TAG_REDIR_OUT=TXT
       setenv _TAG_REDIR_ERR TXT
       set    _TAG_REDIR_ERR=TXT

       alias hostname 'hostname -s'
   breaksw
endsw
# SAP environment
if ( -e $HOME/.sapenv_`hostname`.csh ) then
   source $HOME/.sapenv_`hostname`.csh
else if ( -e $HOME/.sapenv.csh ) then
   source $HOME/.sapenv.csh
endif
# APO environment
if ( -e $HOME/.apoenv_`hostname`.csh ) then
   source $HOME/.apoenv_`hostname`.csh
endif
# LiveCache environment
if ( -e $HOME/.lcenv_`hostname`.csh ) then
   source $HOME/.lcenv_`hostname`.csh
else if ( -e $HOME/.lcenv.csh ) then
   source $HOME/.lcenv.csh
endif
# JAVA environment
if ( -e $HOME/.j2eeenv_`hostname`.csh ) then
   source $HOME/.j2eeenv_`hostname`.csh
else if ( -e $HOME/.j2eeenv.csh ) then
   source $HOME/.j2eeenv.csh
endif
# XI environment
if ( -e $HOME/.xienv_`hostname`.csh ) then
   source $HOME/.xienv_`hostname`.csh
else if ( -e $HOME/.xienv.csh ) then
   source $HOME/.xienv.csh
endif
# RDBMS environment
# @(#) $Id: //bc/701-1_REL/src/ins/SAPINST/impl/tpls/ind/ind/DBSRC.CSH#1 $ SAP
if ( -e $HOME/.dbenv_`hostname`.csh ) then
   source $HOME/.dbenv_`hostname`.csh
else if ( -e $HOME/.dbenv.csh ) then
   source $HOME/.dbenv.csh
endif

Thanks

citroen is correct: the error doesn't come from "su" but from the login process of the user. Possible candidates are: the file "~/.profile" and the file "~/.cshrc".

The difference between "su - user" and "su user" is that "su - user" sets the complete environment for the new user you switch to while "su user" just changes the "effective user ID" and not the environment. If userA does a "su - userB" the session will still have the environment of "userA", but all the privileges of "userB".

I hope this helps.

bakunin

Hi,
You have to find which sourced environment is not correct. You can source .csh files.
Regards

Hi,

Below mentioned are the .csh files under the location /oracle/C38(home directory of user orac38)

.sapenv_dehensv215.csh
.dbenv_dehensv215.csh
.dbenv.csh
.sapenv.csh

But we have compared this files with other systems files, both seems to be the same, but still we are not able to login to this user.

There is another user orac88 in the same server which we are able to succesfully login, we compared the .csh files also, both are same.

Which is the appropriate file which is read when we try to do a SU in server?

Please suggest

Thanks

Hi,
For debug, rename .cshrc -> .chsrc.sos and .profile -> .profile.sos and retry to log in.
Regards

This could be everything and is hard to tell from here. For instance, one conceivable reason: The user in question is not in a group which is necessary to source one of the files you mentioned.

I suggest you do as citroen said and try to nail down the problem by testing good one part of the login process after the other: rename all the files involved as citroen said, then reenable one after the other until the error happens again. Then you have found the culprit. Now repeat the process inside this file to find the offending line, etc..

This is less a technical question than a question of how well your debugging skills are developed. As you need these daily as a systems administrator i suggest you start immediately developing them.

I hope this helps.

bakunin

Hi,

I have modified files .cshrc and .profile as you mentioned.

-rwxrwxr-x    1 orac38   dba            1660 Jun  9 2011  .profile.sos
-rwxrwxr-x    1 orac38   dba            1801 Jun  9 2011  .cshrc.sos

But still i get the same error after login,

0:root@dehensv215:/oracle/C38 # su - orac38
foreach: Words not ()'ed.
% exit

is there any place wer we can see the logs of this user?

Thanks,

Hi,
You may have a .login file. Rename it as .login.sos and try again.
Regards

Not sure what`s going wrong, please try

sudo su - ora32

Put the password of present user

or

pbrun su - ora32

If it is a power broker server

A process to debug what is going on...

Start with getting a listing of the current administration data. Also verify account has not become locked because the issues:

root@x107:[/]lsuser -a home shell pgrp account_locked unsuccessful_login_count idsldap,root
idsldap home=/home/idsldap shell=/usr/bin/ksh pgrp=idsldap account_locked=false
root home=/ shell=/usr/bin/ksh pgrp=system account_locked=false unsuccessful_login_count=0

With output from above - lets say I am interested in user idsldap

# mv /home/idsldap /home/idsldap.save
# mkdir /home/idsldap
# chown idsldap:idsldap /home/idsldap
# su - idsldap

I would expect su command to be fine, default prompt.
Now, move regualr files and directories from /home/idsldap.save back to /home/idsldap

$ exit
# mv /home/idsldap.save/* /home/idsldap
# su - idsldap
$ exit
# ls -lRa /home/idsldap.save

This will show a number of files beginning with a . . One by one move them back to the original home directory - after each file, try a su - idsldap . When that gives the original error message - you have found the file with the error.

Happy Hunting - Hope this helps!