script from ftp to sftp

salmo allikm warhmat allah wabrakato

i have my own server and upload file with ftp with this script

ftp -n xxxxxxxxxcom<<EOF 
user xxxx  xxxx
binary
put image
bye
EOF

i want to convert to sftp or secure protocol
when change to sftp no respond it stop
i don't know how to start
any file need to install?
thanks so much

The reason is this: FTP is a protocol of it's own, while SFTP is an addition to SSH. If there's no SSH server running, you won't be able to use SFTP or scp.

thanks can more details what i must search or do?

First, you must have a FTP client, that supports SSH. (firefox has a great plugin, FireFTP, that does this. Or sftp, in standard repositories of most distros.)
Then, you have to be able to login to the server, that is, you must have a system account, that you can login through SSH.
Then, you should edit your /etc/ssh/sshd_config and comment out the line

Subsystem sftp /usr/lib/openssh/sftp-server

and add

Subsystem sftp internal-sftp

instead.
Then, restart your sshd:

/etc/init.d/ssh restart

Restart your ftp daemon, just in case.
Cross your fingers, and try to login (through port 22, since you are login in through SSH).

can't find sshd_config

Then you need to install sshd. How to do so depends on what your distro is.

thanks so much i installed and do login with fireftp with my server
want to understand the

Restart your ftp daemon, just in case.
Cross your fingers, and try to login (through port 22, since you are login in through SSH).
???

ftp daemon is the process that runs in the background that listens on port 21 (usually) fro FTP connections. It can be pureFTPd, proFTPd, vsftpd,...
so to restart vsftpd, you'd do as root:

/etc/init.d/vsftpd restart

"Cross your fingers", just means "hope for success", or good luck :slight_smile:

If you can login through fireFTP, using SSH, then you're done. Enjoy.