Sponsored Content
Top Forums Shell Programming and Scripting Expect scripting telnet stop on bad username or password Post 302714535 by leemalloy on Friday 12th of October 2012 09:33:35 AM
Old 10-12-2012
Error on the expect

The scrip keeps coming up with an error.

invalid command name "}"
while executing
"}"
(file "./pwd2.exp" line 16)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

username password in script

Can we write a script to telnet to a unix server from unix with the username and password hardcoded in the script?? something like ssh a@b -p password ??? (5 Replies)
Discussion started by: roshanjain2
5 Replies

2. UNIX for Dummies Questions & Answers

how to stop telnet access to AIX box

how do I remove telnet access to my AIX (5.3) machine? I just want people (admins) to connect to the box using ssh? Thanks. (2 Replies)
Discussion started by: johnbrickell
2 Replies

3. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

4. Shell Programming and Scripting

strange expect script behavior, or am i misunderstanding expect scripting?

Hello to all...this is my first post (so please go easy). :) I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Discussion started by: v1k0d3n
2 Replies

5. Ubuntu

Ubuntu Server 810 Telnet ** I know its Bad.. But **

I have a real need to telnet into my new Ubuntu 8.10 server and have Googled my eyes out with ideas that don't work. I CAN telnet out of the server, but I CANNOT telnet into it (connection refused error). I have updated my resolv.conf file but its expert time. ANY IDEAS??? THANKS!!! I knew I was... (13 Replies)
Discussion started by: gbxfan
13 Replies

6. Shell Programming and Scripting

Not able to pass Username and Password in telnet session

I have created a shell script to telnet remote machine. Here is the problem I am not able to pass the login username and password to the telnet session. I have searched forum and got few other methods to achieve this. But I need to know what's wrong in the below script. username="root"... (2 Replies)
Discussion started by: uxpassion
2 Replies

7. Shell Programming and Scripting

Scripting help/advise on hiding/masking username/password

Hi, I currently have a UNIX script with a function that uses a username and password to connect to the database, retrieve some information and then exit. At the moment, am getting the username and password from a hidden plain text file and permission set to -r--------, i.e. read only to who... (1 Reply)
Discussion started by: newbie_01
1 Replies

8. Shell Programming and Scripting

Expect script - going in loops can't stop

Hi First of all I tried lot of forums to create my first expect script. But I am totally stumped at the last step. I am no Linux Admin or ever trained in Linux. I just tried to create the script logically History : I need to to change my password across lot of servers in Linux over ssh ... (4 Replies)
Discussion started by: radioactive9
4 Replies

9. Shell Programming and Scripting

Username and password

Hi I am new to using unix and am struggling with a script i am writing. What i am trying to do is get a user to enter a username, check the original file i created with username and pin to see if their is a corresponding entry. Next ask the user to enter the pin and see if this matches... (5 Replies)
Discussion started by: somersetdan
5 Replies

10. Shell Programming and Scripting

Passing username and password to a script running inside "expect" script

Hi I'm trying to run a script " abc.sh" which triggers "use.sh" . abc.sh is nothing but a "expect" script which provides username and password automatically to the use.sh script. Please find below the scripts: #abc.sh #!/usr/bin/expect -f exec /root/use.sh expect "*name*" send... (1 Reply)
Discussion started by: baddykam
1 Replies
Authen::Simple::Adapter(3pm)				User Contributed Perl Documentation			      Authen::Simple::Adapter(3pm)

NAME
Authen::Simple::Adapter - Adapter class for implementations SYNOPSIS
package Authenticate::Simple::Larry; use strict; use base 'Authen::Simple::Adapter'; __PACKAGE__->options({ secret => { type => Params::Validate::SCALAR, default => 'wall', optional => 1 } }); sub check { my ( $self, $username, $password ) = @_; if ( $username eq 'larry' && $password eq $self->secret ) { $self->log->debug( qq/Successfully authenticated user '$username'./ ) if $self->log; return 1; } $self->log->debug( qq/Failed to authenticate user '$username'. Reason: 'Invalid credentials'/ ) if $self->log; return 0; } 1; DESCRIPTION
Adapter class for implementations. METHODS
o new ( %parameters ) If overloaded, this method should take a hash of parameters. The following options should be valid: o cache ( $ ) Any object that supports "get", "set". Only successful authentications are cached. cache => Cache::FastMmap->new o callback ( & ) A subref that gets called with two scalar references, username and password. callback = sub { my ( $username, $password ) = @_; if ( length($$password) < 6 ) { return 0; # abort, invalid credintials } if ( $$password eq 'secret' ) { return 1; # abort, successful authentication } return; # proceed; } o log ( $ ) Any object that supports "debug", "info", "error" and "warn". log => Log::Log4perl->get_logger('Authen::Simple') log => $r->log log => $r->server->log o init ( \%parameters ) This method is called after construction. It should assign parameters and return the instance. sub init { my ( $self, $parameters ) = @_; # mock with parameters return $self->SUPER::init($parameters); } o authenticate ( $username, $password ) End user method. Applies callback, checks cache and calls "check" unless aborted by callback or a cache hit. o check ( $username, $password ) Must be implemented in sublcass, should return true on success and false on failure. o check_password( $password, $encrypted ) o options ( \%options ) Must be set in subclass, should be a valid Params::Validate specification. Accessors for options will be created unless defined in sublcass. __PACKAGE__->options({ host => { type => Params::Validate::SCALAR, optional => 0 }, port => { type => Params::Validate::SCALAR, default => 80, optional => 1 } }); SEE ALSO
Authen::Simple Authen::Simple::Password Params::Validate AUTHOR
Christian Hansen "chansen@cpan.org" COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-04-19 Authen::Simple::Adapter(3pm)
All times are GMT -4. The time now is 01:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy