file upload to SFTP server from a jsp page - ssh

I have a webpage which contains the button to upload a file. My requirement is, when user chooses the file to upload and click the submits it, the file should get transferred to an SFTP server. My question is, do I need a SSH client installed on the client machine for achieving this?
I thought of uploading it to my http server as a temp file first and then to the SFTP server from there, but then what's the purpose of SFTP on the first place as the file will be transmitted to server as unencrypted.

JSP is a server side technology. If JSP is going to be involved, then the code has to run on the server.
My question is, do I need a SSH client installed on the client machine for achieving this?
No. The server has to do the work.
I thought of uploading it to my http server as a temp file first and then to the SFTP server from there
That's how you would have to do it.
There's no way to interact with the SFTP protocols directly from client side code in a webpage.
then to the SFTP server from there, but then what's the purpose of SFTP on the first place
Good question: But you decided to use that technology, so that's up to you.
as the file will be transmitted to server as unencrypted.
To secure communications between the browser and the HTTP server, use HTTPS instead of plain HTTP.

Related

Does proxy have to load everything completely first before sending them back?

I've been using proxy services, and I want to know some details behind it, regarding its speed and efficiency. Consider following scenario:
There's a mp3 file on server M, a client wants to download that file, but he doesn't want to expose himself, so he decides to use a proxy website to download. The get mp3 request is therefore send to proxy server P first, then proxy server would get that mp3 for the client, here's my question about some details:
Does P have to download the entire mp3 file first before it can pass it to the client? If so, the file is downloaded twice (first on proxy server, then on client's machine) , taking about twice amount of time?
Proxies normally operate in two modes: HTTP and Connect.
The Connect mode is for blackbox protocols like HTTPS or ftp. Where most of the data is meaningless octet streams. Because they are encrypted or unstructured files.
However, for HTTP, proxies are pretty smart. One of the things that they do is caching stuff. Like images and web page contents when you are downloading a website in your browser via proxy.Moreover, for octet streams under HTTP, proxies show the connect behavior, meaning that they open a relay socket and let you download the content. In the meanwhile, they will store it locally, and if it doesn't exceed a certain size the file will be also cached.
The files are also forwarded, or relayed, or sometimes called rewrited. This here is a sample config file that shows squid configured to forward Youtube videos and not caching them.
Another reason why downloading and forwarding is not an option is doubling the round trip time (RTT). It is really counterintuitive when you add another RTT that slows down a HTTP session.

Verifone Application Download over TCP/IP

I have verifone Nurit POS. I want to perform a remote app download. But I don't know how to make my Server ready for it. Can anyone help me with this.
Thanks
Well, you should install an ftp server on ur server. I can suggest you Filezilla Server( Thats what I am using). After that, you should make filezilla server's configuration to point at a file, you ll keep your remote download app.
Then, trigger the remote download with ftp servers username and password. Done! This is how I do it with Nurit 8010. I hope this was what you meant.

SFTP file upload in WCF service

Can anyone help me out on how to implement file upload from mobile device to Dotnet service using SFTP process using WCF service or any.
WCF works on HTTP protocol with or without SSL.
SFTP works on SSH protocol with or without SSL.
FTPS works on FTP protocol using SSL.
First make sure what you exactly want to do and which protocol is suitable for your case.
If you are looking to transfer a file using WCF try to use Stream as input type and store it on a physical location on the disk.

HTTPS or SSH for server-server communication

I have two servers. I wish to send some data ( was doing it with HTTP GET till now ) to a php file residing on the server and get some output from it.
Of late, I saw the requests per second went up to 50 and Apache served HTTP 500 error for some of those. This server has 512 MB RAM and the script, in php-cli mode, usually eats up around 10 MB of memory.
I wish, if it were to reduce the load on server, to use SSH instead of HTTPS. Will it reduce the memory usage on this server (minus what the script itself needs)? Or will too many SSH connections still cause hindrance?
Note - I do not have HTTPS setup right now. But planning to switch over to it. And just then, this issue cropped up.
SSH will not speed up your program. What you can do, is to create your own server on the destination server (which will receive data). The web server do much more than just receive data, like interpret HTTP headers and route your requests to files. Your own server can do the same job in a much lighter way.
http://br.php.net/manual/en/sockets.examples.php has an example of how to do this.
I would use normal HTTP, but encrypt the data sent.
How big is the data you're wanting to transfer? Depending on the size SSH (in particular, SFTP) might very well be better. I say that because... well, when was the last time you tried to upload a 10MB file via a webpage and succeeded? Uploading small files works for HTTP but, at the end of the day, it's not a file transfer protocol.
My recommendation would be to use phpseclib, a pure PHP SFTP implementation. Upload a file via SFTP and then run a PHP script on that file via SSH.

Preferred protocols to upload static files to your Apache server?

If you were the administrator of an Apache web server, what protocol(s) would you prefer to provide, for the web developers to upload static files (html/gif/css/...), with the goal of maximum security ?
If you were the web developer/graphic designer, what protocols would you prefer to be available at the Apache server, to upload static files ?
SCP is what I'd go with.
You can even use Filezilla for it and pretend it's unsecure FTP: http://filezilla-project.org/
SSH/SCP. It's simple, fast, free, and can be as secure as you want. Alternatives are FTP (hahahaha, yeah right) and POSTing files over HTTPS.
I give web developers instructions on using an sftp/scp client and a login shell using scponly. That way they get their access to upload files, but I have fewer concerns about them doing bad things to the webserver.
I use ssh config to limit users to sftp on a development server then use version control to review the changes and move them to production with got format-patch
We deploy using Capistrano, which afaik does all its work via git (over SSH) - at least, in our deploy script it is.