Reg : telnet password issue

Hi All,

I am working on AIX 5.3.

My requirement is to telnet to a server and scp a file from another server
In my shell script i am using telnet to enter to a server and i am echoing the password as below

echo open $Infahost
sleep 1
echo $Infaftplogin
sleep 1
echo $Infaftppasswd
sleep 1

i am getting this as the output....

telnet> Trying...
Connected to kaathr67.
Escape character is '^]'.
getwinsize:ioctl: A specified file does not support the ioctl system call.

telnet (kaathr67)

trysrc
4crows
/usr/local/bin/scp pickme@bridge.share.com:../internal/cmd_ltp* /u98_data/pcenterdata/prod/FTP/cmd_ltp_Extract_20071104_101836.txt

Attention:

Ths is a restricted computer system and is for authorized use only.
Unauthorized use of this system may result in disciplinary action
and/or civil and criminal penalties. Failure to maintain the
confidentiality of sensitive information may subject the user to
penalties under applicable laws. By using this system, the user consents
to monitoring, inspection, and disclosure of all activity for
security purposes.

Authorized Login: trysrc's Password:
/dev/pts/141: Password read timed out -- possible noise on port
Connection closed.

telnet>

whenever i am running the script for the first time i getting this error.
when i rerun it is working fine...This has been repeating for the past few runs...

please advice
sam

stdin is evidently not a terminal or pseudo-terminal. telnet prefers to work directly with terminals.

Can you not use ssh instead of telnet?

i am using telnet to login to a server as user trysrc.
Only trysrc has the permission to run the command scp in our AIX server.

i am calling the shell script cmd_scp as

sh -c 'cmd_scp | telnet'

Could you please tell me how to login using ssh...

sam

ssh user@host