Mount remote FTP server on windows machine - winapi

I want to write code in vc++ to mount remote machine (with FTP server running on remote machine) as local drive on my PC.
Please suggest the API which can mount the remote machine using ftp protocol, like "WNetAddConnection2" uses smb protocol.
Or please suggest something regarding the same.
Thanks in Advance !!!

Manually it can be done through "Add network drive" option in my computer in windows, u need to fill ftp address of server and it will be mounted as local drive.

Hello.
It is not trivial task.
Mounting remote machine as disk required many APIs.
For FTP may use FTP families of WinInet functions, for Shell is required knowledge of pidls and many related shell functions.
Rather use MSIEFTP.DLL/Microsoft Internet Explorer FTP Folder Shell Extension. :-)

Related

How copy,Paste is working form my local system to remote system

Recently we bought dedicated server with Windows.I really surprised windows allowing me to copy files(CTRL+C) from my local system and paste files(CTRL+P) in dedicated server.Vice versa.
Before we tried Linux dedicated server.If you want transfer file from local system(Windows) to dedicated server(Linux),I need to use FTP.But in windows server all these are not needed.
I have a curiosity to know,How the procedure is working internally.For this I search allot,But I didn't found clear materials.So If you know any good material,suggest me.
Thanks.
I'm not sure what your question is precisely. Are you using remote desktop to log into your windows server, and then copying and pasting files between your local system and the remote server? If that's the case, then the copying and pasting is happening within your "remote desktop" client. It's not really related to your server's operating system, per se.

copying files from one windows server to another

I have to copy a file from a windows 2008 server to one or more windows 2008 servers. I have accounts on the target machines with enough privileges to let me use powershell remoting and use wmi. The remote machines do not run ftp, ssh or similar file transfer mechanisms. I am not allowed to install software or run new services on the target server. I can run services on the source server.
The file copy action must be initiated from the source server. i.e. I cannot manually logon to the target machines and initiate the copy - though an automated way to do this is acceptable.
Is it possible to use WMI or PowerShell Remoting to push or pull the file from the source to the target ? Is it possible to invoke some sort of built in http client or invoke the BITS service/agent on the remote servers to pull files from the source server ?
Other suggestions please.
Yes it is possible to copy files using the constraints you've been given. Basically, you will need to ensure the source server has a file share that's accessible by the target host. You will then need to follow the process created by Frank White, here on SO, and fully fleshed out and referenced here, though you'll have to translate from VBS to PS1:
Trying to copy file from one XP PC to another using WMI, since RPC and UNC are not available

automatic Samba share script

I have an Ubuntu 10.04 server running Samba.
I want to write a script (for Linux or Windows computer) that, given the IP of this server and the path of the shared Samba folder, can automatically create a "network drive" icon on the desktop. Both machines are on a local network.
I realize this will be different for linux/windows.
Any suggestions? I'm just not sure where to start. Thanks!
For Windows machines, you want to look at net use. For instance, to map the share "Data" on 192.168.0.2 to Z:, you'd write net use Z: \\192.168.0.2\Data. There is a lot of options, so check net help use for a complete list. For instance, you might want to look at /persistent, which would automatically recreate the share every time you log in.
Or you could put this in a .BAT file which is executed when logging in.
On linux, I think you'd generally have to be root to do this, as it'd require a mount command. I know some desktop environments (such as GNOME) get around this, but to acually mount it you need root. The command to mount the same share at the mountpoint /mnt/Data would simply be mount //192.168.0.2/Data /mnt/Data, if you allow anyone access. If you require a logon, you need to add -o User=YOURUSER. You will then be prompted for a password.
(Note that this requires the CIFS/SMB drivers to work)

What tools do you use to upload files to amazon ec2 Linux instances?

I am using the standard fedora AMI with the LAMP stack bundled and I want to upload files onto the server from my Windows desktop.
What is the "normal" approach for this? I am not a UNIX admin by any stretch, although I am more than comfortable with FTP and the basics of a BASH shell.
As far as I can see there is no FTP server installed by default on the remote virtual machine, and I am unable to open one up at my end because of firewall restrictions. I looked at WinSCP, but before I go to the lengths of installing and configuring that I wondered what the expected means of doing this might be. In any case I don't see how WinSCP or any other FTP based tool can work without the target machine listening, which implies something like and FTP server.
Is there anything like a Windows remote desktop connection?
I could mount an S3 elastic storage volume from within EC2, but it is a bit of a sledgehammer to crack my little nut of just wanting 100k of files copied up to the server.
This is a different question to getting my web application running on the virtual server to save files locally, which is what the other SO questions in a similar vein seem to be asking.
Any ideas welcome.
I use putty's psftp, which uses ssh. If you can ssh into the box, then psftp should work.
http://www.chiark.greenend.org.uk/~sgtatham/putty/
You will first need to convert your pem private key to a ppk using puttygen for psftp to use the keyfile for authentication because it only uses ppk format and not pem format, as far as I know.
You've made the right choice with WinSCP. SCP is based on SSH, not FTP, and SSH and SCP are standard on Linux servers. So, WinSCP takes a bit of configuration bit its the simplest. Your alternative would be to install and maintain and FTP server - a lot more work there! There are equivalents to Remote Desktop but they're way more complicated to setup.
If you're having trouble with configuring your SCP program with your key but you have the ability to "shell" in, you could create a new linux user on the server with a password, then you can use that password instead of the key in WinSCP which is easier.
"In any case I don't see how WinSCP or any other FTP based tool..."
SCP (and SFTP, for that matter) is an entirely different protocol from FTP. Data is transferred over an SSH channel. If you have SSH access to your virtual machine, SCP/SFTP should work.
If you prefer a graphical tool, have a look at the S3Fox Firefox plugin (my choice), or peruse this list of standalone graphical S3 browsers.
For S3 I use Cyberduck (on Mac) and S3Fox. For mass uploads (in scripts) I use s3sync. I manage EC2 Instances with ElasticFox and original ec2 Tools from Amazon.

Modifying files on remote Ubuntu server from Windows PC

I am developing some Python programs that I'm running on a remote Ubuntu Linux server (hosted on Slicehost). I would like to work on the source in an IDE on my Windows Vista PC, and have all file modifications sent directly to the Linux box without my intervention (i.e. without having to manually SFTP the files each time I change them). What is the very easiest way I can do this?
WinSCP includes a basic remote file editor, though if you want to use a proper IDE for your development this won't be much help.
I'd suggest you run a version control system like subversion, which would allow you to write a post-commit hook to automatically rsync your code the server with each commit.
Use PuTTy and SFTPDrive.
PuTTy is an SSH client, and SFTPDrive ($39 USD) will allow you to mount your remote file system locally as a drive letter.
Install Samba and OpenVPN on the server, and OpenVPN on the client. Setup Samba to share the directory tree you're interested in, and access it over the VPN for security. Perhaps Vista has non-sucky WebDAV support by now, and you could use WebDAV over HTTPS, but it was always crap under XP.
Ben's suggestion of a local dev environment using a VM is also a winner.
You could install cygwin and then have rsync run on cron every minute.
Or you could use Netdrive to access the server via FTP like a local disk:
http://tech.xptechsupport.com/netdrive-turn-your-ftp-into-a-drive-letter.html
Or you may be able to achieve something similar using cygwin and FUSE - you can on linux, but never tried it on cygwin.
Also, would it not be easier to set up a full dev environment locally? Maybe using a virtual machine? It'll be much quicker for testing. And then you can set up a shell script to transfer the current version to the slicehost server.

Resources