create a folder in remote server and copy a file there in vb.net - visual-studio-2010

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.

Related

Ubuntu 14.10 - Create an FTP Account

I've searched a lot of websites and have found no answers. How can I create just a normal FTP account (which can be used on Port 22 for Filezilla aswell as the SSH) that is in the folder "/home/hisname"? I want it to only be able to make files in that directory and run them, and make it so he can't mess with any other parts of the system.
I've really been searching all morning. Please help.
As long as you have an FTP server installed, a regular user should be able to use it in authenticated mode - no special qualities needed.
https://help.ubuntu.com/10.04/serverguide/ftp-server.html
This depends on which ftp daemon you use. Normally, FTP accounts are just the normal accounts you use to log in to your machine. You can change a standard user's login directory by modifying /etc/passwd, for example, or when creating the new user.

Working around the Windows OS limitation of not allowing multiple connections to a server/shared resource

We are building a system on windows where we centrally (server) need to do fopen to either local files or remote smb resources. The idea is to authenticate in the case of remote resources before doing fopen (with unc paths).
We need to authenticate with the credentials the user (client application) supplied for this resource on that remote share. We don't want to copy any resources.
Using the Win Net Api this works smoothly since it stores the given credentials so that subsequent fopens in the same or in different processes succeed.
But there is a problem:
Many of you probably know the following message from windows when trying to connect to a smb share with different credentials then the ones used for a previous connection:
"Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again."
See http://support.microsoft.com/kb/938120 for the defined limitation and possible "work arounds".
Since we have a central server application running as a service ('Local System' account) we hit this limitation with having already two different users :).
Closing the previously established connection to allow for the 2nd one is not an option (ongoing processing).
On the one hand it's great that windows caches authentication information on the other hand it's too limited.
Modifying the hosts file for each user does not look very nice.
Using smb client libraries (like libsmb++, impacket) doesn't seem to be the solution since we need "over process" authentication.
Configuring a "master" smb share user is also not wanted.
Maybe passing windows user auth tokens around is a way?
This problem is of general nature (i.e. independent of language) and I'm convinced that there are people out there who solved it (in a more or less elegant way ;))
I hope my explanation is understandable.
Thanks in advance for any hint.
felix

nodejs impersonation with windows

I need to use nodejs to write file to a password protected shared folder on a remote machine running Windows server 2008 r2, how can I do impersonation things within nodejs like .net app does?
Thx in advance!!!
PS:
Sorry for the unclear description. The folder is set to shared across the internal network on the remote windows server system, the folder is set to "readonly" for the windows account explicitly created by the admin. The nodejs server is on the same internal network and need to access the remote shared folder, thus I think nodejs need to impersonate the windows account on the remote machine to read contents from the shared folder. My question is how to do the sorry for the unclear description. The folder is set to shared across the internal network on the remote windows server system, the folder is set to "readonly" for the windows account explicitly created by the admin. The nodejs server is on the same internal network and need to access the remote shared folder, thus I think nodejs need to impersonate the windows account on the remote machine to read contents from the shared folder. My question is how to do the impersonation stuff for nodejs?
Late to the party - but since there is no accepted answer...
You'll need to launch your node process using the account that has access to the network share. How this is done differs based on your setup. For example, if you're runnning node on a lLinux server trying to connect to the remote Windows server, then it's not going to be straightforward with node.
However; if you're running node on a Windows server, trying to connect to a remote share on another Windows server (which is what it sounds like your situation probably is). Again, you'll have to run your node script as a user with access to the remote share. If you need to do it from code, I'd suggest taking a look at my module node-windows. It doesn't provide remote share access specifically, but it will allow you to run command line code with a different account from within your node script.

How to get and send files from an application to another machine or Windows Explorer but not another application?

Sorry if my question is confusing but what I am looking to do is this. I am creating an application that is supposed to send and receive files directly to another machine without having to connect to any other application but the windows explorer on another machine. I know you can write a client and server much like a FTP program, but that's not what I am looking for. An application simply connects to Windows or windows explorer on another machine for sending or receiving files.
I have looked or researched for information online, but not much to look at.
Is there a way to do this? If so, how.
MORE INFO:
I want to be able to start my application on a machine and send and receive files automatically from or to another local machine without establishing any direct connection very much like what Microsoft Window does. You open your windows explorer and drag and drop files from or to another machine. Only that I want to do that programmatically within my application. I start my application and simply request or send for specific file at a specific location. The way I have it written now you have to run two different copies of the same program on different machines - one as a server and the other as a client.
Maybe what I am looking for is a way to get access to the filesystem of another local machine without socket to socket connection.
Thanks in advance.
Windows Explorer is not an application that foreign programs can "connect" to. You need to connect to something that will actually be listening for connections. The most direct way would probably be to set up a network share on the server and then use WNetAddConnection2 to connect to that share on the client.

Can you have virtual users using an SFTP server?

I've had a FTP server (Mac OS X, but not the server version) set up for a while where the users are virtual, i.e. they are not actual user accounts in the server's OS, but accounts handled by the FTP server software -- to the OS they all look like the ftp user account. I'd like to retire the FTP server software and go SFTP instead.
Is there a way to set up SFTP/SSH so that I can create virtual users and at the same time sandbox them?
The reason I want virtual users is because I add and remove accounts from time to time, and doing that with proper user accounts tend to get messy, and I don't know of a good way to sandbox them. There's always some files left and each user has their own user directory (with a lot of files only relevant if they would actually log on to the machine when sitting in front of it), which is quarantined when the account is removed, so you have to remove it by hand yourself, and so on.
The usual generic Unix answer to this is 'PAM'. If you want plain old OpenSSH SSHD to handle your SFTP, you need something plugged in to SSHD's PAM stack (/etc/pam.d/sshd) that does what you need and leaves out what you don't need. This might be a general-purpose directory server (probably LDAP) that maps all your virtual users to one home directory and gives them a restricted or scponly kind of shell.
If you want to look at FTP servers that can also do FTP-ssl (which is not the same as SFTP), good ftp servers like Pure-ftpd or vsftp will do that. FTP-ssl servers have simpler virtual user support.
http://www.bsdguides.org/guides/freebsd/networking/pure-ftpd_virtual_users.php
If you're open to commercial products, VShell Server from Van Dyke Software is available on Unix/Linux/Windows, supports virtual users (multiple backends) with SSH and SFTP protocols:
VShell Server
JSCAPE SFTP Server is a commercial, cross-platform server that does what you want.
http://www.jscape.com/
I know, sounds like I work for them, but I don't :)
There is sftpgo which supports virtual users and much more.

Resources