PDA

View Full Version : How to write a shell script to do a non interactive login


ak1920
06-04-02, 07:15
How can I write a shell script in order to do a non interactive login, with a specific user name and password. Execute a local existent shell scrip with the logged user environment. I would like to do the same for five different user at the same Unix AIX computer.

Thanks and best regards

Mrs. Guadalupe brodbek

Guadalupe.deBrodbek@swisscom.com

:confused:

rnealejr
06-04-02, 22:45
I am more familiar with solaris but I will give AIX a shot:

The following is based on AIX 5.1.0:

You can try the global environment files:

/etc/profile and /etc/environment - just modify the script to check for the user(s) you want to include in this group. Also, there is a skeleton script file created under /etc/security/.profile. A configuration for security exists for users under /etc/security/user.

Well, I hope this helps. I have used the /etc/profile script to add additional functionality to help me with specific users.

Good luck.

geoffgomez
10-21-02, 09:12
From the root account the following should work:

su - <username> -c <command>


Hope this helps,
Geoff

WingMan
10-22-02, 08:16
If you connecting from a different Unix box then you could set up a remote shell and use the 'rsh' command. This allows you to run scripts on a different machine without having to login.

(HP-UX you need to use the command 'remsh')