Anubhaw
Anubhaw

Reputation: 6068

Error while connecting to sftp using shell script

I am getting following error while trying to connect to a sftp server:-

ncftpput: cannot open http://mydomain.com: unknown host.

Code which I am using is as following:-

FTPU="username" # ftp login name

FTPP="password" # ftp password

FTPS="http://mydomain.com"# remote ftp server

FTPF="/home" # remote ftp server directory for $FTPU> & $FTPP

LOCALD="/localpath"

ncftpput -m -u $FTPU -p $FTPP $FTPS $FTPF $LOCALD

I am currently running this script on fedora 10...

thanks.....

Upvotes: 1

Views: 1588

Answers (1)

Christian
Christian

Reputation: 1549

ncftpput is an FTP client that does not support SSH (see their FAQs). Also, in your script you're providing an HTTP URL instead of just a server name. If mydomain.com actually runs an FTP server, try FTPS=mydomain.com instead.

Upvotes: 1

Related Questions