ssh

I am using the following ssh command to access the remote server. when i do it manuaaly from "$" prompt it asks the password and when I give the right password this works:
ssh xyz@10.10.123.145

But, if i am doing it in a shell scripting, how to pass the password with in the script.
I tried the below which didn't work . Still it prompts me for the password

#!/bin/csh
passwd=1234
ssh xyz:$passwd@10.10.123.145
echo "connected to remote server"

Please help me on this..
Thank you

you're not going to get it to work that way; ssh is built for secure communication and simply passing your password into the process is not very secure.

You'll need to read up further on ssh, as it may vary according to your ssh client, ssh host and maybe even both.

$ man ssh
$ ssh --help

However, if you're scripting ssh you're probably looking for a non-interactive session which pretty much points you towards needing some credentials-based authentication, usually without a pass-phrase. Read up on your local ssh details from the commands above, then search this site for the way too many examples of how to do it right. [Some threads may refer to expect as an option...but this is not altogether clear-cut, nor is it on every machine...]

If you're still unable to move ahead, pop back onto this thread with your next questions. HTH

You can use expect .

Exploring Expect: Chapter 3 Getting Started With Expect

#!/usr/bin/expect

set timeout -1

    spawn ssh -l admin 10.123.21.23
    send \r
    expect word:
    send admin\r
    expect $
    # Add your operations

    send "touch filetest\r"
    expect "$"  
    send exit\r
    expect eof

....but it is an extremely bad idea, not to be suggested unless there is absolutely no alternative.