interface login by shell scripting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting interface login by shell scripting
# 1  
Old 04-12-2011
interface login by shell scripting

Hi,
I am trying to write a script which would get some data from an interface.
However the problem is that I have to enter username and passwd as i enter the interface.

I tried
(user;passwd;command)|telnet xxxx
however I can't enter the passwd like this.

How can I enter the interface?

Thanx,
# 2  
Old 04-12-2011
Try a here document:
Code:
telnet 1.2.3.4 <<EOF
   username
   passwd
   command
   exit
EOF

The EOF (can be anything the shel disregards completely), delimits the commands you would type into the terminal. Note: the last EOF must be in the leftmost column, column #1. Always.
# 3  
Old 04-13-2011
The here document doesn't work for me:

Try a sleep command before every command and then echo the actual command. Remember that we want the command to execute on the remote computer.
Code:
(sleep 4;echo "username";sleep 2;echo "password";echo "pwd";sleep 2;echo "exit")|telnet 1.2.3.4

My simple example is to execute the unix "pwd" command on the remote computer. The "sleep" values may need adjustment according to what you are running.


Unless the remote end has very limited commands there will no doubt be a better method using Remote Shell or whatever.

Last edited by methyl; 04-13-2011 at 06:47 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How can i get Solaris interface ip using shell script?

HI Community, my server has more than 15 zones and each one is having virtual interface of 10G adapter (qlge0) if the filter the output of ifconfig -a | grep inet, it's showing all interfaces including virtual. i have take first like from the output and assumed that as my main ip is... (3 Replies)
Discussion started by: bentech4u
3 Replies

2. Shell Programming and Scripting

Web Interface for shell script.

Hi Team, I have daily pdf files which i have to convert in tif images. I have script which does it. I need to put these images in some specific folder (which i create manually) on server. Is there any web based way to it, so that user can simply browse file & it will convert & upload on... (1 Reply)
Discussion started by: paragnehete
1 Replies

3. Shell Programming and Scripting

Script as login shell (passing args to login shell)

Hello all, for security reasons my compagny imposes that my script be launch remotly via ssh under the users login shell. So serverA launches the ssh command to serverB which has a local user with my script as a login shell. Local script works like a charm on his own. serverB$ grep... (20 Replies)
Discussion started by: maverick72
20 Replies

4. Shell Programming and Scripting

Shell script trigger using http interface

Hi I have created a shell program, which takes a series of parameters as shown in the below code. Its working good from terminal. My program restorejob.sh -g <NAME> -p <Path-to-search> -r <Path-to-restore> Its working fine from bash shell. I want to extend this functionality like... (1 Reply)
Discussion started by: rakeshkumar
1 Replies

5. Shell Programming and Scripting

User interface for the shell script

Hi, I have written a shell script that does the job of downloading a build file and upgrading a application on my test linux system. This shell is a interactive script where the user needs to enter certain info like the remote system on which the upgrade has to be performed and the build number... (2 Replies)
Discussion started by: sunrexstar
2 Replies

6. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

7. OS X (Apple)

Terminal scripting to automate login to cisco devices. Help Please !

Hello, I am new to the mac world, and would like to automate my login to cisco devices (routers, switches etc...), i am in a need of writing a script that i may just click on an icon on the desktop and it will open terminal and run a few command. as follow: telnet to an ip address type... (2 Replies)
Discussion started by: drdread
2 Replies

8. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

9. HP-UX

cannot login after changing login shell

Hello Everyone, I am a newbie in unix. I was practicing shell scripts on hp unix machine. I changed my current login shell (Korn) to Bourne shell giving the following command. $ chsh username /usr/bash I am using secure shell client for accessing the hp ux server. After which i... (4 Replies)
Discussion started by: hardesh
4 Replies

10. UNIX for Advanced & Expert Users

graphical interface via remote login

I use telent or netterm to remotely login onto a linux sever, but I could only use the command-line interface. I want to know how can I use the graphical interface such as KDE or GNOME. Thanks a lot.:p (3 Replies)
Discussion started by: guanglei_li
3 Replies
Login or Register to Ask a Question