Make ssh and send commands

Hi,

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

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 :frowning:

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

Can anyone help me?

Thanks :o

to do "interactive" scripting you need a tool like "expect".

Manpage of EXPECT

Thanks.

Can you just give me a simple example how expect can be used to make a login?

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