Originally Posted by
Lars Noodén
Check the manual page for
sftp for details, but the general usage is with the username and remote host:
Code:
sftp -l user server.example.org
Inside sftp, put and get are your two main commands, but there are many others described in the manual page.
Pardon me but can you explain that to me by a example...
What i have to do is download a certain file from the server and move it to my home folder..
how can i use sftp protocol in shell script?? i even tried from my terminal but no avail.. here is what it's saying
Code:
krishna@ubuntu:~$ sftp -l mohan 10.40.70.68
usage: sftp [-1246Cpqrv] [-B buffer_size] [-b batchfile] [-c cipher]
[-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]
[-o ssh_option] [-P port] [-R num_requests] [-S program]
[-s subsystem | sftp_server] host
sftp [user@]host[:file ...]
sftp [user@]host[:dir[/]]
sftp -b batchfile [user@]host
krishna@ubuntu:~$ sftp -l mohan 10.40.70.68 /home/mohan/link
usage: sftp [-1246Cpqrv] [-B buffer_size] [-b batchfile] [-c cipher]
[-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]
[-o ssh_option] [-P port] [-R num_requests] [-S program]
[-s subsystem | sftp_server] host
sftp [user@]host[:file ...]
sftp [user@]host[:dir[/]]
sftp -b batchfile [user@]host
krishna@ubuntu:~$ sftp -l mohan 10.40.70.68 : /home/mohan/link
usage: sftp [-1246Cpqrv] [-B buffer_size] [-b batchfile] [-c cipher]
[-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]
[-o ssh_option] [-P port] [-R num_requests] [-S program]
[-s subsystem | sftp_server] host
sftp [user@]host[:file ...]
sftp [user@]host[:dir[/]]
sftp -b batchfile [user@]host
krishna@ubuntu:~$ sftp -l mohan 10.40.70.68: /home/mohan/link
usage: sftp [-1246Cpqrv] [-B buffer_size] [-b batchfile] [-c cipher]
[-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]
[-o ssh_option] [-P port] [-R num_requests] [-S program]
[-s subsystem | sftp_server] host
sftp [user@]host[:file ...]
sftp [user@]host[:dir[/]]
sftp -b batchfile [user@]host
krishna@ubuntu:~$ sftp -o mohan 10.40.70.68: /home/mohan/link
command-line: line 0: Bad configuration option: mohan
Couldn't read packet: Connection reset by peer
krishna@ubuntu:~$ sftp -o 10.40.70.68
usage: sftp [-1246Cpqrv] [-B buffer_size] [-b batchfile] [-c cipher]
[-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]
[-o ssh_option] [-P port] [-R num_requests] [-S program]
[-s subsystem | sftp_server] host
sftp [user@]host[:file ...]
sftp [user@]host[:dir[/]]
sftp -b batchfile [user@]host
Bookmarks