- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: login with username and password in script usi...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2008 06:06 AM
тАО12-16-2008 06:06 AM
login with username and password in script using `expect and send` binaries
I have some 50 unix servers in my DC. I want to execute a script to get the status of the user id's going to expire.
succeed in script also...But it is asking username and password while login to other machines.
I have given the script here for your reference(100% ok with script and tested also in single server)
I heard that `expect and send` wil do these type of things... But i dont know the syntax and where i have to download these binaries....
It could be fine if it is like this....
1)user1@xxx.xx
password:
su - root
Password:
2)run the script
3)ftp the output file
4)logout
Note:
1)Trusting of ssh is disabled, no chance to enable it.
2)Direct root login is also disabled.
PLEASE HELP ME!!!
SCRIPT:
for USER in $(listusers | awk '{ print $1 }')
do
EXPDATE=$(logins -x -l $USER | tail -1 | awk '{print $4}')
if [ $EXPDATE -lt 3 ]
then
export HN=`hostname`
export IP=`cat /etc/hosts | grep $HOSTNAME | cut -f 1`
print "HOSTNAME:$HN\nIP\t:"$IP"\n$USER Password expires in $EXPDATE dates" > test.doc
#mailx -s "hi" $USER < test.doc
ftp -v -n 172.xxx.xxx.xx << !EOF
user username passwd
bi
mput test.doc
yes
bye
!EOF
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2008 06:23 AM
тАО12-16-2008 06:23 AM
Re: login with username and password in script using `expect and send` binaries
I'd approach it a little differently.
I'd have a single master server and place its public ssh key on all other systems as authorized_keys file
Then I'd write a script that did this.
while read -r system
do
ssh $system "passwd -a"
# run any report you want place a custom report script on all systems.
done > list
list contains list of systems
For more on password free access with ssh public keys:
http://www.hpux.ws/?p=10
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2008 03:46 AM
тАО12-17-2008 03:46 AM
Re: login with username and password in script using `expect and send` binaries
I have already stated that " ssh trusting is not possible in our environment... it is disabled for security resons..."
I need to supply the password by someother way...
Do you know about expect and send binaries..?
Anyway thanks for the link..
Regards,
Jenith Christopher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2008 05:42 AM
тАО12-17-2008 05:42 AM
Re: login with username and password in script using `expect and send` binaries
> is not possible in our environment... it
> is disabled for security resons..."
So, if I understand this correctly, SSH is
_not_ secure enough, but storing the "root"
password in a file _is_ secure enough?
AIIEEE!!!!
> Do you know about expect and send binaries..?
You tried a Google search for, say,
hp-ux expect
and found nothing useful? Really?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2008 06:55 AM
тАО12-17-2008 06:55 AM
Re: login with username and password in script using `expect and send` binaries
Understood Steve.. Plese reply me if anyother way is there except ssh-trusting.
Regards,
Jenith Christopher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2008 07:12 AM
тАО12-17-2008 07:12 AM
Re: login with username and password in script using `expect and send` binaries
if rlogin / remsh / rexec are currently allowed, then setting up rhosts on the "other" servers will allow account on one server to get in w/o passwd to the other servers....again all of the above are insecure and "bad" from a audit perspective.
ssh w/ keys is far more secure and should be acceptable to auditors