The UNIX and Linux Forums  

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
How do i change to super user then revert back to ordinary user ,using shell script? wrapster Shell Programming and Scripting 3 06-04-2008 08:11 AM
AIX; Auto clearing of 'too many invalid login attempts by user' Keith Johnson AIX 0 01-02-2007 03:54 PM
solari s 10 auto account locking BG_JrAdmin SUN Solaris 3 06-28-2006 06:41 PM
Setting an account to be a non-login account automatically? LordJezo UNIX for Dummies Questions & Answers 0 06-16-2006 10:28 AM
freebsd auto login user at boot / i'm stuck termiEEE UNIX for Dummies Questions & Answers 6 02-26-2004 01:18 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 09-15-2008
anup13 anup13 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 18
Exclamation auto login to Super User account

i want to write to script which will login to su account without hving user interaction.( i know Super user password)
i wrote following script its also able to log into su account. but seesion gets terminates soon.
what can be done ???
or is there any other solution. i don't want to use expect tool

HOST="host ip address" # have to put host ip address
DELAY=1

USER="anup"
UPASS="user password"
SUSER="root"
SPASS="root password"
ACC=6
#exec 4>&2

telnet $HOST >&2 2>&2 |&
sleep $DELAY
print -p $USER
sleep $DELAY
print -p $UPASS
sleep $DELAY
print -p $ACC
sleep $DELAY
print -p login
sleep $DELAY
print -p $SUSER
sleep $DELAY
print -p $SPASS

please help me out
thanks and regards
  #2 (permalink)  
Old 09-15-2008
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,576
Dont get you here:
If there is no user interaction then you are talking batch... in batch when execution is finished the shell exits...
If its only to not have to pass a passwd, why not just use rlogin or remsh (rsh) with .rhosts file or even better: ssh
  #3 (permalink)  
Old 09-15-2008
anup13 anup13 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 18
Quote:
Originally Posted by vbe View Post
Dont get you here:
If there is no user interaction then you are talking batch... in batch when execution is finished the shell exits...
If its only to not have to pass a passwd, why not just use rlogin or remsh (rsh) with .rhosts file or even better: ssh
i don't have ssh installed and cant install also. can you tell me how to use rsh with .rhosts.
actually i m writing script so that user can login to root account without entering password. like automated login.
  #4 (permalink)  
Old 09-16-2008
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,576
You could even do it on the same box...(rlogin to itself...)
In root's directory you create a file calles .rhosts with per line :
<hostname> <user>
you chmod the file 400
depending of platforms you may need to add the <hostname> and ip in /etc/hosts
some configure /etc/hosts.equiv....

Start by your own account and let you remsh on another box, once youve seen how it works try to figure out the best way for you in terms of security...

Thinking of it cant you install sudo? there is an option no passwd...
  #5 (permalink)  
Old 03-18-2009
zechan zechan is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 3
Autologin Script in Korn shell

Wasap guys

I work for a software company which uses AIX and Korn shell.
I’m new to shell scripting and Unix in general, I’m trying to write a batch file or script , which pypass rlogin, typing user name, password and dialing a client remotly.
So, I’ve created the following

rlogin SGGORA1
input 'userid?';

type LF;
waitfor 'Password', 3 seconds : nolog;
input nodisplay 'passowrd?';
type LF;

call NESIMA


had to mention
-We don’t have ssh installed
-no input found when I type which input
SGGORA1 still ask me for a user id and password.

Can you please help
Thank you
zech
  #6 (permalink)  
Old 03-18-2009
robsonde robsonde is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 162
Putting the root password in a script is very bad.

Don't do it.
  #7 (permalink)  
Old 03-19-2009
zechan zechan is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 3
No thats not the root password.. its the user passowrd.
I tried rlogin -l <user>, so I was able in bypassing typing the user id.. but dont know how to bypass the password one.
Closed Thread

Bookmarks

Tags
auto loggin

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 05:56 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