Make ssh and send commands


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Make ssh and send commands
# 1  
Old 03-04-2009
Make ssh and send commands

Hi,

I'm trying to make an SSH into a SGSN node and collect some commands printouts.Smilie

I really don't know how this can be done.

I think it must be like this:

#!/bin/bash
ssh user@192.168.88.10

Then I must enter the password, but I don't know how to do it, I tried with:
echo password

But it doesn't work Smilie

After making the login I want to collect some printout's.

Can anyone help me?

Thanks Smilie
# 2  
Old 03-04-2009
to do "interactive" scripting you need a tool like "expect".

Manpage of EXPECT
# 3  
Old 03-04-2009
Thanks.

Can you just give me a simple example how expect can be used to make a login?
# 4  
Old 03-04-2009
please use google to answer questions like this! the first hit for "expect ssh login" is this:

SSH login expect shell script to supply username and password

which should help you out...

hth,
DN2
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Send AT Commands to mgetty?

Hello All, I've been working on something which requires a dialup USB Modem. I have been using minicom with success entering "AT Commands" directly into the terminal window that shows after running the minicom command. I had already configured the modem through minicom and was able to... (2 Replies)
Discussion started by: mrm5102
2 Replies

2. Programming

how can i make that a process child send a signal?

I'm trying to do a program that makes activate an signal (SINGALARM) when the next child of a son appears but this not works. I have to caught the next child o the other (pid), to send a singnal which inform a menssage. It's anything worng in the code? thanks. the code: #include... (2 Replies)
Discussion started by: marmaster
2 Replies

3. Shell Programming and Scripting

Send Remote Commands via SSH with variables

Hi there I found the Command to send commands to other servers like: sv01> ssh user@sv02 'ps -ef' But I cant use Variables from a script i want to execute on another server like: sv01> ssh user@sv02 'cd $SCRIPTHOME' although the variable is set on sv01. How can I run commands on sv02 with... (2 Replies)
Discussion started by: DarkSwiss
2 Replies

4. Shell Programming and Scripting

Bash commands to an 'ssh' within an ssh'

I've struggled to find a solution to this problem from searching so I thought I'd write a post to see what can be done. I'm attempting to connect and run commands on 'server2' but because of security limitations I cannot access it directly. I can however ssh into 'server1' and then into... (7 Replies)
Discussion started by: mcintosh.jamie
7 Replies

5. Shell Programming and Scripting

could not send commands SSH session with Net::SSH::Expect

I am using Net::SSH::Expect to connect to the device(iLO) with SSH. After the $ssh->login() I'm able to view the prompt, but not able to send any coommands. With the putty I can connect to the device and execute the commands without any issues. Here is the sample script my $ssh =... (0 Replies)
Discussion started by: hansini
0 Replies

6. Shell Programming and Scripting

make un shell script to send email

Hi, Someone Knows how to obtein a chain from a unix file, but not all the line, for exemple, for this file ,obtein only 902111111 and to keep the value, this value will be used to make a mailx. NF=ALL, SUBJ= FROM: SN=CD, SE=TOPCALL, NA=, N=902111111, N=TCLFI TO: SE=FAX, NA=, C1=... (0 Replies)
Discussion started by: peybol
0 Replies

7. UNIX for Dummies Questions & Answers

Cannot use Make commands

I just cant use any of the make commands. Any ideas? I already tried adding the path of the make command in my profile But nothing happened The error returned is Make: Could not read current directory. Stop. Please help me on this. (1 Reply)
Discussion started by: khestoi
1 Replies

8. Shell Programming and Scripting

How to make a script out of commands

Hi, I have a very basic knowledge of Unix and I need your help for a small script that will do the following commands that I do manually by just giving the filename TPR20080414.txt cut -d'|' -f3,4 TPR20080414.txt> oe_012.lkp awk -F "|" '{temp=$1;$1=$2;$2=temp}1' OFS="|" oe_012.lkp >... (3 Replies)
Discussion started by: sickboy
3 Replies

9. HP-UX

make fuser send SIGTERM?

Hello, Nice forum BTW... anyway on to my question. I am trying to write a korn shell script that will shut down a java VM. The first challenge was how to figure out which java VM to kill, as there can be other java processes running at the same time. Then I discovered fuser. It says it... (4 Replies)
Discussion started by: adamides
4 Replies

10. UNIX for Dummies Questions & Answers

make and make install commands

Hi there, I am installing a package at the moment on to my Solaris version 8 and I have run into a problem with the 'make' command. I have installed the package using the 'pkgadd' command and I am now at the stage where I have to use the 'make' command followed by the 'make install'... (4 Replies)
Discussion started by: gerwhelan
4 Replies
Login or Register to Ask a Question