1836786 Members
2626 Online
110110 Solutions
New Discussion

Re: Login without passwd

 
Allanm
Super Advisor

Login without passwd


I have a number of application ids for which I need to login quite frequently , I want to find a way to have the passwd's fed into a file and passed on through a script. ( exec ? )

thanks.
12 REPLIES 12
Aussan
Respected Contributor

Re: Login without passwd

use sudo, you can execute a command as root or another user with sudo
The tongue weighs practically nothing, but so few people can hold it
Allanm
Super Advisor

Re: Login without passwd


Unfortunately cant use sudo.
A. Clay Stephenson
Acclaimed Contributor

Re: Login without passwd

There are two approaches that come to mind:

1) Create setuid wrappers which run as root and thus no password prompting is required.

2) Use expect. http://hpux.its.tudelft.nl/hppd/hpux/Tcl/expect-5.43/
If it ain't broke, I can fix that.
Aussan
Respected Contributor

Re: Login without passwd

have you ever used a script called expect,
it's a good scripting language especially for telnet connections and entering and expecting parameters and prompts, it's good for automation.

here is an example of an expect script automating a telnet session that i found on the net

# Assume $remote_server, $my_user_id, $my_password, and $my_command were read in earlier
# in the script.
# Open a telnet session to a remote server, and wait for a username prompt.
spawn telnet $remote_server
expect "username:"
# Send the username, and then wait for a password prompt.
send "$my_user_id\r"
expect "password:"
# Send the password, and then wait for a shell prompt.
send "$my_password\r"
expect "%"
# Send the prebuilt command, and then wait for another shell prompt.
send "$my_command\r"
expect "%"
# Capture the results of the command into a variable. This can be displayed, or written to disk.
set results $expect_out(buffer)
# Exit the telnet session, and wait for a special end-of-file character.
send "exit\r"
expect eof
The tongue weighs practically nothing, but so few people can hold it
Allanm
Super Advisor

Re: Login without passwd


Thanks for the suggestion but I am a non root user and just want to do it through a script.
Aussan
Respected Contributor

Re: Login without passwd

you can with expect

here is the official expect site

http://expect.nist.gov/
The tongue weighs practically nothing, but so few people can hold it

Re: Login without passwd

When you say login as a user ID, do you mean from your workstation (presumably Windows PC?), to a shell prompt as an application user without having to provide a password?

If so the a ssh client should do what you require PuTTY is the most common. The following link is for Linux but should work for HP-UX as well:

http://linux-sxs.org/networking/openssh.putty.html

HTH

Duncan

I am an HPE Employee
Accept or Kudo
OldSchool
Honored Contributor

Re: Login without passwd

a) expect, b) ssh if the keys / authentication are set-up properly, c)
if using terminal emulator software such as HOSTACCESS or TinyTerm, you can script the login to terminals.

note that option c is *generally* frowned upon, especially by auditors
Allanm
Super Advisor

Re: Login without passwd

i first login through my userid using my secureid and then su to other app accounts.

So I want to have a script which logins into a userid with the passwd embebded into that script and issue some commands and then come back to my login id.

Re: Login without passwd

If sudo won't do it, you can look at RBAC if you are on 11iv2 or later:

http://docs.hp.com/en/5991-8678/5991-8678.pdf

(see chapter 3 and onwards)

Unfortunately you still need someone with root access to configure this for you, but it should be already installed on 11iv2/11iv3 systems.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Allanm
Super Advisor

Re: Login without passwd

i figured out through rsh.
Dennis Handly
Acclaimed Contributor

Re: Login without passwd

>i figured out through rsh.

I assume you meant remsh?
You could just set up .rhosts so you don't need a password to login into another user.