script from ftp to sftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script from ftp to sftp
# 1  
Old 07-12-2011
script from ftp to sftp

salmo allikm warhmat allah wabrakato

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

Code:
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
# 2  
Old 07-12-2011
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.
# 3  
Old 07-12-2011
Quote:
Originally Posted by pludi
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?
# 4  
Old 07-12-2011
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
Code:
Subsystem sftp /usr/lib/openssh/sftp-server

and add
Code:
Subsystem sftp internal-sftp

instead.
Then, restart your sshd:
Code:
/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).
# 5  
Old 07-12-2011
Quote:
Originally Posted by mirni
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
Code:
Subsystem sftp /usr/lib/openssh/sftp-server

and add
Code:
Subsystem sftp internal-sftp

instead.
Then, restart your sshd:
Code:
/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
# 6  
Old 07-12-2011
Then you need to install sshd. How to do so depends on what your distro is.
# 7  
Old 07-12-2011
Quote:
Originally Posted by Corona688
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).
???
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP and SFTP functionality

Hi Friends, I need to make a Unix script, where i need ftp and sftp functionality. Let me describe in details: I need to import few files from remote server, now these remote server either support ftp or sftp not both. So i need a script where my script will try to do ftp first and if it... (8 Replies)
Discussion started by: gnnsprapa
8 Replies

2. Shell Programming and Scripting

Migration from FTP to SFTP

Hi Everyone, We are migrating from FTP to SFTP. We used the following script for FTP: echo "ftp -np -i -v << EOF" >> ${FTP_READY_FILE} echo "open ${SRC_FTP_SERVER} " >> ${FTP_READY_FILE} echo "user ${SRC_FTP_USER} ${SRC_FTP_PWD}" >> ${FTP_READY_FILE} echo "binary" >> ${FTP_READY_FILE}... (5 Replies)
Discussion started by: Jigsaw16
5 Replies

3. Shell Programming and Scripting

lftp script to connect to external sftp site and download to internal ftp and then send email

Hi there, I'm new to shell scripting and need some help if possible? I need to create a shell script (.sh) to run as a cron job on an ubuntu linux server to connect to an external sftp sites directory using credentials (which I have) and then download to our internal ftp server and then copy... (3 Replies)
Discussion started by: ghath
3 Replies

4. Shell Programming and Scripting

replacing ftp with sftp in the script....

Hi, I have the following bash script(related to ftp) that read the parameters from the properties file and then transfer some files to the remote machine... following is the bash script .... #!/bin/sh . ftp.properties ftp -vin >> ftp.log <<-! open $RemoteIp user... (7 Replies)
Discussion started by: rahul125
7 Replies

5. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

6. AIX

AIX ftp/sftp script monitor to failed logins

Hi All, Any idea on how to write a script on AIX 5.3 to monitor ftp or sftp login failed. Thanks and more power, Itik (2 Replies)
Discussion started by: itik
2 Replies

7. Shell Programming and Scripting

'Upgrading' to sftp from ftp

Somebody made a policy that 'we use sftp now instead of ftp'. I have recommended we use scp because I can't for the life of me think of a *good* reason to use sftp and not scp. But most of what I do is stupid stuff without a good reason. I get judged on how much I can just say yes, no matter how... (1 Reply)
Discussion started by: CodeMonkey76
1 Replies

8. Shell Programming and Scripting

FTP to SFTP conversion

Hi, I have the following ftp code to check the status of communication channel : /bin/ftp -i -v -n -B 64 $HOST <<END 2>&1 > $LOGFILE user $user $password bye END I need to re write exactly the same way with SFTP using authentication keys, I know how to do SFTP with authentication keys.... (4 Replies)
Discussion started by: shihabvk
4 Replies

9. Shell Programming and Scripting

FTP to SFTP conversion

Hi, I have the following ftp code to check the status of communication channel : /bin/ftp -i -v -n -B 64 $HOST <<END 2>&1 > $LOGFILE user $user $password bye END I need to re write to use SFTP, I know how to do SFTP with authentication keys. But my problem is, when the authentication... (0 Replies)
Discussion started by: shihabvk
0 Replies

10. Cybersecurity

FTP v's SFTP

Hi, I'm being told that I have to start using SFTP from my server (HPUX 11i), so heres a few questions; What are the differences between FTP and SFTP? What differences in congiuration can I expect? Are there any changes in command usage? I did see an earlier thread with command issues. A few... (3 Replies)
Discussion started by: nhatch
3 Replies
Login or Register to Ask a Question