On the fly file encryption in Windows server 2008 R2 - windows

Is there a possibility to encrypt a file "on the fly" in windows while copying file via FTP to remote storage?
i don't know if that description is good enough but i want to do something in the way of gpg -e file > ftp://xxx
or will i just have to rely on cygwin?
i'm using windows server 2008 R2 and the file i'm copying is around 750GB in size so it's not possible to encrypt it first and then copy it.

The file as written to local storage via ftp will simply reflect the bytes sent to it from the client. It would have to be encrypted after it was received,b as ftp has no native encryption that I know of.

Not with anything built in to FTP. If you used SFTP or SCP, or WEBDEV over SSL/TLS, you could get encryption for trassport, but the data on the other end will still be encrypted. In fact, the lack of encryption ( for transport) in FTP was why SFTP was developed
If you don't mind writing some code, you cause C# to encrypt data as its copying it over very easily.
Get a crypto-stream from AES and simply back the stream with a network stream/ftp stream . This should avoid writing the data back to disk. You'd simply be reading of disk a few bytes at a time, encrypting, and then writing the data to the network.
You might be able to do a similar thing with powershell.

Related

Renci SSH NET Upload Large File Failure

I've been using a .NET DLL by Renci SSH NET which transfers the files from local machine to secure FTP. It was working fine for small files but this has a problem while uploading large files through my application. I increased the buffer time, operation time out but it still doesn't upload. When I debugged my code, it stuck at the point where I'm uploading & it does not even throw any error.
Any Suggestions Please?
Thanks
Per your description, it's not clear if the issue caused by your codes or by the SFTP server, so I would like to suggest:
Use a ftp client to upload the same file to the SFTP server to see if that OK.
If OK, then you can use network monitor tool, such as wireshark, tcpdump, to check if the issue is caused by network unstable.
Also, by using the network monitor tool, you can check if the upload process stop at the same point every time.
Hopefully that would helpful.

Opening network file from excel vba code on MAC uses offline file

I have excel with macros run in Mac OS.
One of the macros uses Workbooks.Open to open a file in network folder (a SharePoint site).
It works fine if there is connection into the network.
Also it works fine if the user of the Mac profile runs the macro for the first time with the network connection on or off. If there is no connection Mac returns error like it should when run first time.
However the problem is that after the user has succesfully used the file (macro) with the connection on once then Workbooks.Open does not return any error when running the macro second time and the network connection is down.
I added exit sub command right after the Open method and could see that there is same network file open on excel with status of 'Offline file'. That file was the same as the one previously opened when using the macro with network open for the first time. However the file was not fetched from the network drive as this time there is no connection to network.
Tried to find the file from Mac file system, without success.
What creates the offline copy and where is it stored?
How to delete the offline file via vba code or how to prevent excel (or Mac) from creating it ever again?
Br,
MikkoT
You should disable oplocks in the SMB protocol.
Oplocks are opportunistic locks, a client-side performance enhancement
that requires cooperation between a Windows client and the SMB
service. If SMB service supports oplocks, the client can request to
cache a file locally, in order to perform read and write operations on
the cached file rather than directly on the server. This saves network
bandwidth and increases performance for the SMB client. If another SMB
client requests access to the file, the SMB service notifies the
holder of the oplock, and that client should write changes from its
cache back to the SMB service. The SMB service does not let another
client have access to the file until the first client has finished
writing.

create a folder in remote server and copy a file there in vb.net

I tried searching on net for hours but couldn't get any useful answer. It would be of great help if I could be provided with a code accomplishing this.
I have IP address of a remote server which is password protected (it needs user name and password to login)
I need to write a code in VB.NET that creates a folder in this remote server and copies a file from local server (in which the code is executing) to the remote server.
thanks in advance
This is not technically possible, its a way of hacking.
Thats why we have other technology to do it i.e. FTP, SFTP, Webdav.
I would suggest you to do same, use either of above technologies and do your stuff.

Receive File via SFTP/SSH and automatically forward to FTP on another server

I'm currently in a situation where I receive flat files via FTP from my clients. A couple of clients have insisted on the need to use SSH Private Key SFTP rather than regular FTP.
What I want to do is setup a web server (preferably in linux/unix but I guess I can do it on a windows server and purchase SFTP server software) that will do the following:
Allow me to setup an SFTP directory for each client with unique user/pass. Each directory also has to have the public/private key SSH "stuff" I'm a little new to this but I've googled it.
Once the file is completely uploaded by the client, I want to kick off an event that ftp's that file via regular FTP to my Windows cloud.
These files can be up to 10mb so the even that ftp's to the other server can't fire until the file is completely uploaded.
Has anyone set something like this up? Any guidance would be appreciated.
Thanks!
In Linux, you can use incron to monitor the directory the files will be SFTP'd to and have it trigger your ftp job. It's kind of like cron except that instead of triggering jobs based on time, it does so based on filesystem modifications. In order to only trigger once the entire file has been written, I think you can use IN_CLOSE_WRITE in the inotify mask. Failing this, I suggest configuring events for each of the events individually to echo a message to a log file and see if you can identify one which reliably happens only at the end of the SFTP transfer.
If you're using RedHat, it's not in the standard distribution, but it is in EPEL.
On Windows you could use Titan FTP Server Enterprise Edition, which supports SFTP as well as allows you to define various types of events. When the event is triggered, you could kick off anything you need on a per folder/per account basis.
PS. AFAIK, when it comes to SFTP it is either password authentication or public key authentication (SSH key), but not both.
In your UNIX server, you can configure SSH to use a custom sftp server that instead of handling SFTP protocol itself, opens a new SSH connection to to the Windows SFTP server using password authentication and forwards the SFTP traffic there.
Writting the proxy is easy with the right tools, for instance, in Perl using the Net::OpenSSH module:
#!/usr/bin/perl
# this is the sftp-proxy-server
use Net::OpenSSH;
my $ssh = Net::OpenSSH->new($windows_server, $user, $passwd);
$ssh->system({ssh_opts => '-s'}, 'sftp');
$ssh->error and die $ssh->error;
You can instruct the SSH server to use that alternative SFTP server changing the configuration in /etc/ssh/sshd_config. For instance:
Subsystem sftp /usr/local/bin/sftp-proxy-server
Did you try apache FTP Serveur ?
I think you can do what you need with the ftplet API.
see :
http://mina.apache.org/ftpserver-project/index.html

Copying files to a remote server over FTP protocol

I use Filezilla to do my FTP duties and I'm unable to copy files without making a copy to the my local computer.
I doubt Filezilla is bad software. Is this just an inherent quality of FTP?
The FTP Protocol does not define a "copy" command.
If your FTP client has a copy command, then it has to implement this itself using what's available through FTP. This works out to something like: GET/RETR , CWD , PUT/STOR .
Some FTP servers will implement proprietary extensions and offer a command like COPY. A client may or may not choose to implement these, in which case it doesn't involve a local file copy.
According to the error messages I get within WinSCP when I try and duplicate or copy.. apparently it is.
I'm guessing there's some FTP theory on it somewhere. Even to duplicate WinSCP wanted to temp dump stuff to my local machine.
There aren't any copy commands listed at the list of FTP commands, so it's not in the FTP definition. It's just something FTP clients add themselves to be more user-friendly.

Resources