1847086 Members
5356 Online
110262 Solutions
New Discussion

Re: problem whit su

 
Jose Ramirez_6
Advisor

problem whit su

Hi.

I have a problem whit su, when i execute:
su - amass "ll" the system request
Mot de passe :
requestTERM = (hp)

is posible what the system don't request that?
i think that if include this line in the cron don't execute correct.

thank you for help me.


jose ramirez
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: problem whit su

You need to drop the "-" from the su command. You do not want to source .profile because it contains commands that assumes you have a terminal (stty, tabs, ...). Use su without the "-" and set your environment variables inside your cron script.
If it ain't broke, I can fix that.
Vincent Farrugia
Honored Contributor

Re: problem whit su

Hello,

If you are root, then su does not require to enter the password for the user amass.

But if you are not root, I'm afraid you have the enter the password.

HTH,
Vince
Tape Drives RULE!!!
Hai Nguyen_1
Honored Contributor

Re: problem whit su

Comment out the following line in ~amass/.login:

# eval `tset -s -Q -m ':?hp' `

Then you can run you su command. The original eval command in .login is not really needed most of the times.

Hai

Fragon
Trusted Contributor

Re: problem whit su

Try "su amass"!
If you still must use "su - amass" , I think there must be some conflict in $HOME/.profile. You can comment out certain lines to have a test.

live as you wish
ux
Wodisch_1
Honored Contributor

Re: problem whit su

Hi,

put that line with "tset" or "ttytype" into an "if-then" statement:

if [ -t 0 ]; then
tset ...
fi

Then it will only be executed when you "su" interactively, but not fform "cron" or "at"!

HTH,
Wodisch