aspose file tools*
The moose likes Java in General and the fly likes Ssh or sftp sever Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Ssh or sftp sever" Watch "Ssh or sftp sever" New topic
Author

Ssh or sftp sever

Shalu Barman
Greenhorn

Joined: Aug 03, 2012
Posts: 4
Hey .. could anyone please help me about how to make sftp or ssh server .... I want to use jsch or sftp library and its written everywhere that it connects to sssh/sftp sever... but not getting anything about how to make the server part.... ???
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Why do you want to do this? There are SSH servers for all known platforms, nearly all open source and free.

Most of the time, there is no real sftp server, its just a normal FTP server that you access using SSH.

ssh is a service that uses strong crypto. It is not easy to write code that properly uses strong crypto. It is, in fact, easy to write code that poorly uses strong crypto and is full of holes that are worse than using no security -- because they provide the appearance and feel of security without actually providing anything.
Shalu Barman
Greenhorn

Joined: Aug 03, 2012
Posts: 4
I just want to transfer file from one system to another using jsch or sftp library.. i dont understand do i need to make server side coding for this because its given everywhere that it connects to ssh or sftp server.. ?? or just i have to do client side only.. i am making chat project using socket programming..the chat is going fine.. but i want to transfer files also... any idea.. correct me if am going in wrong direction.. ??
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

I think you are going in a wrong direction, but I can't be sure, as I'm not sure I am understanding what you want to do.

Start out transfering the data you want using the shell ssh/sftp programs, or if you have to use Windows, use putty.
Get that to work. Get all the proper servers working.

Then, if you really want to do it with a java library, you can easily test your code against the working shell programs.

I'm not familiar with "jsch or sftp library". Is there such a thing? What does the documentation say you need to do?
Shalu Barman
Greenhorn

Joined: Aug 03, 2012
Posts: 4
i just wanted to transfer files from one system to another ... want to add data transferring feature in my chat application(socket programming) any idea how to do this.. ??
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

That is two requirements.

I suggest you approach them separately. Divide and conquer.

First, make sure you can transfer files. Note: most folks use 'scp' to transfer files rather than sftp.

Second: if your requirement is to have your chat program transfer files, don't start worrying about details of how you do it. You may be able to just use System.exec() to run the scp
command.
Shalu Barman
Greenhorn

Joined: Aug 03, 2012
Posts: 4
i need to use jsch library for that or something else.... ??
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Shalu Barman wrote:i need to use jsch library for that or something else.... ??


again, I don't understand your question. Have you done the first step that I suggested? It needs no library and no java
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4714
    
    7

You don't have to program anything on the server side. As Pat has been trying to tell you, if you can transfer the files to the intended servers manually by using utilities like scp or sftp, then you have everything you need on the servers. Just write your client code to transfer the files.


Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ssh or sftp sever