ehtukesoyyo
27th June 2003, 15:06
HI!

How a user and a company can be replaced in UNIX to execute a sesion with user simulating to be another user?

tanks

günther
27th June 2003, 15:14
If you know the password of root, you could do a 'su' and then a 'su >>the other user's id<<'. After that you *are* the other user, and you could easily run 'ba6.1'.

ssbaan
27th June 2003, 16:37
Would not ba6.1 have a problem if you changed the user from the logged on user? I think I remember getting a error something like the variable $USERNAME did not agree with the actual user ($LOGNAME).

As far as the company number, we wrote a script that accepts a passed company number and then edits the user file (u file) and changes the user's home company number(compnr: xxx). before doing this though, you have to make sure the uesr(s) in question have been granted access to the company in BaaN.

Juergen
27th June 2003, 16:49
ssbaan is right,

forget my post. I was a little bit to fast. This works only if you create different baan users with the same system login.

I delete my wrong posting!

Thanks ssbaan for correct me.

Rgds,
Juergen

Markus Schmitz
27th June 2003, 17:25
sorry, ssbaan is not right.

we "su" all the time. Why should that be a problem?

If you use "su", then you do not need any "USERNAME".

test it and tell me I am wrong :-)

Markus

ssellens
27th June 2003, 17:28
Also try using the '-' after the su command; su -

this will pick the the user's environment just like you had logged in as that user. This may help with the $USERNAME problem.

Hope this is of help.

Steve

bdittmar
29th June 2003, 11:51
Take su to switch to superuser (root)

"su - username" takes the actual Baan (user) environment.

ssbaan
30th June 2003, 18:21
I sit corrected!!

Mr. Schmitx is right about su and $USERNAME. In checking some old notes, this is a problem we had on an old porting set.

$USERNAME is no longer used by BaaN.

Also Steve is 100% correct about su, always better when using
su to use the dash (-) command, unless you want the user running with the original environment and Unix access.
Also note that by using the dash command, the Unix variable $LOGNAME is changed to the new user id. Not using the dash command leaves the $LOGNAME as the original user id.