auto login to Super User account


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting auto login to Super User account
# 1  
Old 09-15-2008
Error 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 Smilie

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 Smilie
# 2  
Old 09-15-2008
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  
Old 09-15-2008
Quote:
Originally Posted by vbe
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  
Old 09-16-2008
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  
Old 03-18-2009
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  
Old 03-19-2009
Putting the root password in a script is very bad.

Don't do it.
# 7  
Old 03-19-2009
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Solaris 11 user account login expired

Hi everyone Please i need urgent help... I have installed solaris 11 using live media.. then i installed sunray.. every thing is fine.. but after system reboot i am unable to login on server on GUI it gives account expired error or some time authentication failed... but i can log in through... (11 Replies)
Discussion started by: amk
11 Replies

2. AIX

User Account Login Login on your AIX server

I want to learn AIX. I would like to find someone who would be willing to give me a login to their AIX home lab server. My intent is to poke around and discover the similarities and differences of AIX compared to other *NIXs. I am a UNIX admin so I can think of what some immediate concerns may... (1 Reply)
Discussion started by: perl_in_my_shel
1 Replies

3. UNIX for Dummies Questions & Answers

User account with no login shell

Hi All, I was reading a tutorial for Installing Tomcat on Linux machine. (http://www.puschitz.com/InstallingTomcat.html) Here the author had mentioned that: For security reasons I created a user account with no login shell for running the Tomcat server. My question is: 1. What is a User... (6 Replies)
Discussion started by: jw_amp
6 Replies

4. Debian

password less login to root from a user account

hello friends, one user is created named "user1" I login as "user1" . Now when i do "su -" to be root user I have to give password for root . Is there any way through which we can skip giving the password to root. i.e. user1@work:~$ su - Password: xxxxxx work:~$ I don't want that... (1 Reply)
Discussion started by: pradeepreddy
1 Replies

5. Shell Programming and Scripting

How do i change to super user then revert back to ordinary user ,using shell script?

Hi all, I am trying to eject the cdrom from a livecd after certain stage... Now assuming that it is possible to eject,please consider my issue!!! The OS boots into a regular user by default...so i am unable to use the eject command to push out the drive... However if i try pfexec eject it... (3 Replies)
Discussion started by: wrapster
3 Replies

6. Linux

Auto create local account with winbind.

Hi, I have a set up a linux box connected to windows active directory using winbind. Everything is up and running fine. Now i wish to auto create a local account whenever a new user logs in. I have tried every possible way using the smb.conf to no avail. Any help would be appreciated. (1 Reply)
Discussion started by: d_ark
1 Replies

7. AIX

AIX; Auto clearing of 'too many invalid login attempts by user'

Does anyone have a good script / cron job that handles this? I have looked in smit and see it is clearing this count with: chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s '{userid}' However when I looked around to find ways to automate this I have not found an easy... (0 Replies)
Discussion started by: Keith Johnson
0 Replies

8. Solaris

solari s 10 auto account locking

does anyone know in solaris 10, can you lock an account if the user does not change their password within a certain amount of time? What i want to do is, if a user doesnt change their password within 90 days, i want the account locked. This is similar to the redhat linux passwd -i command. ... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

9. UNIX for Dummies Questions & Answers

Setting an account to be a non-login account automatically?

Is there a way to easily change an account to be a non login account (NP in the shadow) file? I know I can just edit the file but that is not what we want to do. We use access control software and want to provide a way to set an account to be non-login using simple commands that can be mapped... (0 Replies)
Discussion started by: LordJezo
0 Replies

10. UNIX for Dummies Questions & Answers

freebsd auto login user at boot / i'm stuck

I run freebsd 4.8 and try to find the way or 'a' way to log in a certain user i created automaticaly at pc boot. I have searched the net, the manuals, but found nothing... could anyone please get me going by showing me an example or what file(s) i need to take a look at. i am not working... (6 Replies)
Discussion started by: termiEEE
6 Replies
Login or Register to Ask a Question