The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
[ksh] useradd chodaboy UNIX for Dummies Questions & Answers 3 06-30-2006 09:24 AM
useradd question thumper UNIX for Dummies Questions & Answers 1 03-14-2006 02:54 PM
useradd Selma SUN Solaris 4 06-13-2005 07:33 AM
useradd dorilevy UNIX for Advanced & Expert Users 2 10-19-2004 02:15 AM
useradd ortsvorsteher UNIX for Dummies Questions & Answers 6 05-30-2002 03:28 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-26-2007
earlysame55 earlysame55 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 23
useradd

Gurus,
I need to add a user to all the machines. I need a script to do this. I did one but it does not allow me to su to root within a ssh session i open. It exists saying su: Sorry. Please let me know how i can do it. I do not have the freedom of using sudo either.
Regards
  #2 (permalink)  
Old 08-26-2007
kamitsin's Avatar
kamitsin kamitsin is offline
Registered User
  
 

Join Date: Nov 2006
Location: /dev/null
Posts: 177
Try using expect.

Cheers,
K
  #3 (permalink)  
Old 08-26-2007
earlysame55 earlysame55 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 23
Thanks, shall try it. But does it require me to pass the password in or hardcode the passwd in the script?
  #4 (permalink)  
Old 08-27-2007
anchal_khare anchal_khare is offline
Registered User
  
 

Join Date: Jun 2007
Location: Mumbai,India
Posts: 325
u can pass the password as an environment variable if u dont want to hardcode them.

define all the variable in another file
and just execute the following command.

. /path/passwords.txt

ur password.txt may contain

user=myuser
password=mypassword

use $user and $password in ur orignal script.



Anchal
  #5 (permalink)  
Old 08-28-2007
kamitsin's Avatar
kamitsin kamitsin is offline
Registered User
  
 

Join Date: Nov 2006
Location: /dev/null
Posts: 177
expect can use .rhosts file for remote host operations.

Cheers,
K
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0