If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > How to write a shell script to do a non interactive login

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-04-02, 06:15
ak1920 ak1920 is offline
Registered User
 
Join Date: Jun 2002
Location: Fribourg Switzerland
Posts: 1
Question How to write a shell script to do a non interactive login

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

Reply With Quote
  #2 (permalink)  
Old 06-04-02, 21:45
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
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.
Reply With Quote
  #3 (permalink)  
Old 10-21-02, 08:12
geoffgomez geoffgomez is offline
Registered User
 
Join Date: Apr 2002
Posts: 17
From the root account the following should work:

su - <username> -c <command>


Hope this helps,
Geoff
Reply With Quote
  #4 (permalink)  
Old 10-22-02, 07:16
WingMan WingMan is offline
Registered User
 
Join Date: Aug 2002
Location: UK
Posts: 87
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')
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On