Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Trouble whit command SU
Name: amaury_salazar Date: September 7, 2005 at 06:54:06 Pacific OS: UNIX aix 4.3 CPU/Ram: R6000
Comment:
Hi, I would like to know, how can i run the user ( su - Pepe) from a shell script passing the password for parameter or is there another command that do the same? because I run the command but the system gives me the password all time. I would to want what the proccess will be running automatic without what i have to put the password.
Name: nails Date: September 7, 2005 at 10:02:10 Pacific
Reply:
This question is asked a lot. The best solution I've seen is to use the expect scripting language. Bundled with expect, is a demo program that does exactly what you're asking for. Here is a modified version of it that you should be able to modify:
#!/usr/local/bin/expect -- # wrapper to make passwd(1) be non-interactive # username is passed as 1st arg, passwd as 2nd # exutable only by root
Summary: I have 2 you scheme one it is HP-UX w-hp4 B.11.11 OR 9000/800 and the other one is SunOS isis 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-250 The problem is that when from user's bill I connect ...
Summary: Is there some part of this you are having trouble with? commands 2>junk writes an actual file named "junk". The usual practice for discarding error output is commands 2>/dev/null or commands 2>&- ...
Summary: I am running a Solaris 8 machine and I used to be able to use the su command from ssh and right on the machine itself but now all of the sudden I can not do either! I can easily su from root to any us...