Identifying a user on a AIX shared workload


 
Thread Tools Search this Thread
Operating Systems AIX Identifying a user on a AIX shared workload
# 1  
Old 09-11-2012
Identifying a user on a AIX shared workload

Hi,

We access our workloads using usrun. Login is automatic as we are either in the profile for that workload or not.

So each user logs into the same account - e.g. wloadexe

Each of the users logs in from a machine where they have their own account. e.g. johndoe

So when they log in, all the files etc.. they create are under the wloadexe profile and everyone logs in using the same .profile though the _history file is unique for each user.

The problem is that everyone want different settings in their profile - but the common profile is loaded each time.

I'm looking for a way to identify the username (johndoe) from the server they logged in from. This must be possible because the history file is set.

e.g. HISTFILE=/wload/bart/home/bartexe/.sh_history_johndoe

SET shows no variables which contain the username other than this one.


Thanks
# 2  
Old 09-11-2012
there might be several ways to achieve this, and since it's already implemented you should check where and how the HISTFILE variable is set


you can also do it this way:

first on the ssh client:

set in /etc/profile system wide, or in each users profile:

Code:
REMOTEUSER=${USER}


add to /etc/ssh/ssh_config
Code:
SendEnv REMOTEUSER


on the ssh server:

change /etc/ssh/sshd_config

Code:
AcceptEnv REMOTEUSER


restart sshd


every time you log in, the variable REMOTEUSER is set to the ssh clients source username, now you can use this variable to set an user specific environment
# 3  
Old 09-12-2012
You could also use the "who am i" command to see where each user came from and execute other profiles based off of that:
Code:
hostname:/:$ who am i
username        pts/0       Sep 12 12:27     (remotehost.domain.com)
hostname:/:$ who am i | cut -d\( -f2 | cut -d\) -f1
remotehost.domain.com
hostname:/:$

You could put all your custom changes into profile in $HOME named "profile.johndoe" file and then your current shared profile would have something like this in it near the end to execute your custom profiles:
Code:
REMOTE_HOST=$(who am i | cut -d\( -f2 | cut -d\) -f1)
## If the custom profile exists, dot it into the environment
if [ -f $HOME/profile.${REMOTE_HOST} ]; then
     . ${HOME}/${REMOTE_HOST}
fi

Of course, this would assume they are all coming from different originating hosts.
# 4  
Old 09-12-2012
this will give you the remote hostname, but not the required remote username

Quote:
I'm looking for a way to identify the username (johndoe) from the server they logged in from
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Identifying Underlying Physical Core Count - AIX

Hi guys, I was wondering if you could help me out with a query I had. Is there a query to identify the total processor core count of the physical AIX box from which I am running 4 LPARs. I have run the lscfg, lparstat-i and lsdev -Cc processor commands however they just show me the cores... (9 Replies)
Discussion started by: OsmosisJones
9 Replies

2. AIX

Cannot get shared lock on database for rpm on AIX 6.1

Hello, I was trying to install python on aix and it was taking too long and I closed the terminal. Now when i issue the command rpm -qa instead of getting all the rpms installed I'm getting the following error. root:stud -> $ rpm -qa cannot get shared lock on database rpmQuery: rpmdbOpen()... (2 Replies)
Discussion started by: gaugeta
2 Replies

3. AIX

Loading a shared library in AIX

Hi, I have an application running on AIX. The app is deployed on Webspshere server. Due to some reason, i have to make use of a third party library (Sigar API's) from my application. This library requires an .so file as well. Is there any location where i can put this *.so file and it will... (1 Reply)
Discussion started by: user_guest
1 Replies

4. AIX

AIX 5.2 C++ shared object issue

Hi all, I am developing an application with two components. One "c" binary and one "C++" shared object. While execution, the shared object crashes out and core dump is created whenever "new" is executed. But if i use malloc this will work perfectly. I tried to use dbx. Below given was... (1 Reply)
Discussion started by: itssujith
1 Replies

5. AIX

CD Rom shared for many AIX servers.

Guy's I have more than 20 servers available in different locations and I want to configure CD Rom as NFS between these servers to be sharedCan any one explain the configuration how can NFS or share CD rom between more than 20 servers available in different locationsto be used in one time from all... (5 Replies)
Discussion started by: Mr.AIX
5 Replies

6. Infrastructure Monitoring

snmpget not working on AIX shared wpar

Hi, I have a shared AIX wpar configured. I have started snmpd process on shared AIX wpar. But when i tried to query a MIB id using the following command /opt/OV/bin/snmpget -d -v 1 -c public -p <hostname> .1.3.6.1.2.1.1.7.0 i get the following error message #... (0 Replies)
Discussion started by: avazeer
0 Replies

7. UNIX for Advanced & Expert Users

Identifying generic scsi disk on AIX 5.3

I was wondering if anyone knew of any tools that would identify generic scsi disks on servers running AIX 5.3? Going through diag into the hot plugs does not work. I know it used to for 4.3 on some servers I managed with generic scsi but for some reason I either dont the option to choose a disk... (2 Replies)
Discussion started by: plcj58
2 Replies

8. UNIX for Advanced & Expert Users

Issue with shared object in AIX

Hi All, I have a problem with the shared objects setup in AIX. We have a customized shell written by the developers over here. When i issue a MQ Series command (mqsilist) it is giving the error as . All the commands making use of this libImbCmdLib.a.so is failing. But when executed in normal... (1 Reply)
Discussion started by: dhanamurthy
1 Replies

9. AIX

memory problem in AIX shared libraries

Hi All, I'm facing the following issue with my shared libraries in AIX. memory related calls such as memset, memcpy, malloc etc are failing miserably. there is something wrong with stack/memory which i can't guess. i've used the following flags to build my libraray: ld -G... (0 Replies)
Discussion started by: abhinav05252
0 Replies

10. AIX

How to debug a shared library(.so file) on AIX?

How to debug a shared library(.so file) on AIX? (1 Reply)
Discussion started by: AlbertGao
1 Replies
Login or Register to Ask a Question