Java upload files to remote linux server WITHOUT f

2019-08-27 19:04发布

I am trying to write a program in java to upload some files from my local environment to a remote server. I cannot use FTP because there is no FTP server installed on that instance. Also port 22 is closed so I can't use scp either.

Is there any other way to approach this?

Thanks in advance guys!

3条回答
唯我独甜
2楼-- · 2019-08-27 19:15

Even linux servers sometimes use smb/cifs (the Microsoft technique to share files and folders) to publish data. The samba team provides a 100% Java library to access those: http://jcifs.samba.org/

查看更多
劳资没心,怎么记你
3楼-- · 2019-08-27 19:19

You need something on the serverside, a program, which is waiting for your file. You can't just send something there.

An open port is always a program running, waiting for a connect.

查看更多
一纸荒年 Trace。
4楼-- · 2019-08-27 19:33

So a couple of possible protocols are rsync and WebDav. But at the end of the day I recommend one of two options. Get ssh installed, or use rsync.

Talk to the unix admin and work something out.

查看更多
登录 后发表回答