Automatic login script

Hi,

I'm a beginner in unix.As a part of my script i need to remote logon using ssh.
my script run as being asked for password and logons only after the user enters the password correctly. But my script stops executing after that as I login to a different server(different shell if i'm right). Could anyone suggest me how to overcome this.

thanks.
daya

Can you post the syntax that you are using for the ssh command? ssh will, by default, give you a shell on the remote system. Any commands that are present after the ssh command will be run only after the ssh command exits.

Are you able to use ssh keys? If so, I would recommend that.

I want to be able to tell who is using my machine. I am looking for examples of a bash shell script that will be used on a Linix server. It has to run at once each day and take 5 minute samplings.

Thanks in Advance.