How can I share files between a raspberry pi and windows? [closed] - windows

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
How can I share files between a raspberry pi and a windows computer?
(Like in a public folder or something like that)

There is a lot of confusion about the idea of sharing files. Some folks mean one thing, some folks mean another.
Exchanging files or transferring files. By "sharing", some people mean exchanging files or copying files between machines - that means you have to actually physically transfer files between the machines and either means using (old-fashioned) FTP or File Transfer Protocol (often with an FTP client/server like the excellent FileZilla) or the newer scp to Secure Copy files across a network, or copying to a USB memory stick and transferring them physically on foot.
Shared directories. In this setup, one machine acts as an SMB/Samba Server and the other as an SMB/Samba client. There are other possible filesystems (such as NFS) but they are not native to Windows, unlike SMB/Samba which is the native Windows network file sharing protocol. To my mind, it is easier to have Windows act as the server since Windows can do that anyway - rather than install and configure sharing software on your Pi. It doesn't make any difference which machine is the server and which is the client really, so let's set up Windows as the server and the Pi as the client so you don't need to install any extra software anywhere.
On Windows machine
Create a shared folder with very insecure permissions until you get set up and working properly - you can always close things down and tighten things up later. So you choose a folder to share, right-click on it and choose "Share" and then set it up for sharing - with loose permissions.
As an alternative, you can do this at the command prompt:
NET SHARE sharename=drive:path
Check that Windows is indeed sharing a folder when you are done. There is no point doing anything on your Raspberry Pi until the following command shows you are sharing a folder from the Windows side.
NET SHARE
On Raspberry Pi
Create a mount point where you would like the Windows files to appear:
sudo mkdir /WINDOWS
Now mount the shared directory so it appears on the Pi:
sudo mount -t cifs -o username=username,password=password //WINDOWS_IP_ADDRESS/share-name /WINDOWS
You can also use the Windows machine name rather than its IP address.
You should now see all your Windows files in /WINDOWS and you should be able to put files there and see them from your Windows machine
If you want to unmount the shared directory:
sudo umount /WINDOWS
If you want to always mount the shared directory when your Pi boots, you need to edit /etc/fstab and add an entry at the bottom along the lines of the mount command above to mount it always at boot:
//WINDOWS_IP_ADDRESS/sharename /WINDOWS cifs guest,uid=1000,iocharset=utf8 0 0
Once it is all working, please consider closing down and tightening up the access permissions.

I recommend WinSCP. It's not only easy to share files but also easy to edit and update it.

Related

Windows file share under Cygwin?

I have an issue with mounting Windows file share in Cygwin.
We have Windows file share which is using NFS to share content. I was assigned to install Cygwin on it so some application can connect over SFTP to that server.
Now they need to access the shared folder from that application and the app would pull data from that folder.The thing is that the folder is Windows shared folder (exmple; \server\photos). the current Windows users need to be able to connect to that share (it is mapped to their M drive) and the app need to connect to SFTP and pull the data from there.
My idea was to mount that NFS share in Cygwin and set it as /home directory so when the app connects, it automatically goes there.
My questions are: is this possible, and does anyone know any better solutions?
I am open for all suggestions.
Thank you.
Cygwin views the top of its directory tree / to be within the Windows directory C:\cygwin64 (or whatever its installation directory was). As a result, you are unable to move above that point in the filesystem from a Cygwin shell. The solution is to go through Cygwin's directory /cygdrive, which is automatically set up as the access point where all Windows disk drives are mounted. If your shared folder is mounted in Windows as M:, you should be able to access it in Cygwin as /cygdrive/m without any additional work.
As far as setting it up as /home, you might be able to create a symbolic link from /home to /cygdrive/m if that is what you need.

home web/file server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
At Home we have a lot of media Content on three computers. I was thinking of centralizing them on one single machine that runs a web server that hosts all the content, and when we fetch a URL like : http://localhost/music it will show a HTML file that lists all the music files on the computer, and when we click on a file, it gets downloaded.
I don't know what to use so as to make this thing, I think Apache as a server and PHP as a language..., any suggestions?
Install FreeNAS on your machine
http://www.freenas.org/
You don't even need to go that far. Just install apache on a computer and have your music folder be a web directory. You should be able to navigate to the page like so: http://whateverip/music/ and apache will serve up that html page like you are suggesting.
If using windows, XAMPP is a pretty good solution. You don't really need the PHP part, because all you need on the server after installing a WAMP solution, is to place all your content in the folder that the server uses.
If using Linux, definately install LAMP, there is an easy install of it whether using Ubuntu or other Linux distrubtions.
If using a MAC, there are similar solutions as LAMP. Some are hassle-free.
In any case, all of these use Apache as the server; that is the way to go. It's not as hard as you think, just install the software, and put your files in the appropriate directory, then from each of the other machines, to find the files you would probably type this into your address bar:
http://192.168.1.101/
Which of course is the address of the web server on your Local area network. It is very likely an address that is very similar to that, maybe ending with two different last two numbers.
I would second the freenas route if what you want to store is valuable to you in terms of time or money or electricity. It makes a great headless fileserver with web GUI, supports ZFS filesystem (similar to software RAID5 so you can lose a disk and not lose your data). More valuable to me it also supports replication to a duplicate server.
It can run on very low power hardware using freeBSD as the OS. I measured one of my boxes and it uses about 45 Watts. The OS loads from a USB stick so all your disks become data disks. It holds the system in RAM so your USB does not get any writes to it so the USB lasts a very long time. It will serve CIFS for your windows boxes, AFP for your macs, and NFS for your linux systems. Plug-ins allow for such things as DLNA media servers. I have had three boxes running stable with no reboots for over a year with 6x 3TB drives per box.
A typical hardware setup might be ASUS C60M1-I AMD Fusion board (combined CPU/VGA/NICC/6SATA)for about 75 bucks, 16GB RAM, PSU, USB stick - and voila - add 3 hard drives and you have a low-power RAID fileserver. Get two and you can replicate one server to another in a different physical location.

Copy Files from Remote RDP to Local Machine [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
Is there a way I can launch a RDP session to a remote Windows server, and perform a file transfer to the local computer? Versions of the remote Windows Server varies. Ranges anywhere from 2000 to 2008.
I've tried to look up solutions and it seems scattered everywhere. Some suggest using mstsc.exe, others suggest PowerShell / Java / ASP Net. I'm confused. Appreciate some guidance here.
Thanks!
Update Below: 17 Feb 2012
Thanks for all suggestions. Would like to add that the remote servers are securely locked down and I'm not allowed to install SSH servers, FTP servers, or shared drives. The only way for accessing the remote machine is through RDP, and these machines are also on separate VLANs to which only authorised users can use RDP to access these machines. I'm trying to create a script that can help authorised users to download the required files.
You can map a drive using remote desktop.
Options > Local Resources > More
Ctrl + C at the Remote Desktop, and Ctrl + V at local, if you not looking for any automated solution. (Please check RD Config to enable copy and paste)
Once you have mapped the drives you want using mstsc, you can use \\tsclient to access the file system of the local machine i.e the Terminal services client from which you have RDP'ed on to the remote box.
If all you are trying to do is copy file from a remote box, just do \\machine\c$\path etc or share the folder and do \\machine\share to get them. RDP is not necessary in this case.
Once you have mapped the needed drives as Andy says, you can execute remotely a LOCAL batch file every time you connect specifying it's local path (using \\tsclient\c to refer your local drive) in the Programs tab at RDP properties.
Remember to write cmd /c before that path.
The rdp connection will automatically close once the batch file ends, but you can add the pause command to the end to see what happened during execution.
Connecting this way, you can edit the batch file before connecting.
Make sure your remote Machine enabled PSRemoting by running the following command in PowerShell
Enable-PSRemoting –Force
From the client computer, run the following command to establish the connection.
net use "\\{RemoteIP}\c$" "{Password}" /USER:"{Username}" /persistent:no
Here after you can use Copy-Item, Delete-Item over the network.
Copy-Item [PACKAGEPATH]\* \\[COMPUTER]\c$\installers -recurse
In Client machine, Run->mstsc.exe-> Local Resources-> enable clipboard.
In remote machine-> windows run command (Windows Key + R).
Open cmd->(Taskkill.exe /im rdpclip.exe) type brackets command
You got "Success", then
Type same command prompt "rdpclip.exe"
Now copy and paste both, its working fine
You can copy and paste files over RDP, it works perfectly. See http://www.reddit.com/r/sysadmin/comments/1d6a1o/til_you_can_copy_and_paste_files_over_rdp/ for more info.
eug wrote what I thing is an extremely useful comment that seems to have overlooked by everyone:
You can very easily share a single folder by using subst to map it to a drive letter, and then selecting that drive in remote desktop.
Note that it's fairly easily to have problems with this method due to subst performing the mapping only for the user under which it is run.
So I recommend to run everything from a single command prompt:
Open a command prompt (Win+R -> cmd)
Type subst <lettertomap>: <pathtofolder>
Type mstsc (which launches Remote Desktop)
Keep in mind that the subst mappings are not persistent across reboots, of course, so this is mostly convenient for a one-time session of file transfer.
There are actually also other ways to do the mapping, see raymond.cc .
And yes, the mapping does seem to disallow access to the rest of the drive, although I wouldn't bet my life that it doesn't have chroot-like "vulnerabilities" (assuming it is supposed to be secure in the first place).
1) Install dropbox or equivalent cloud storage product and sync needed files that way between computers. Remember, you can allow only certain folders to be synced on specific devices (you don't have to sync the entire dropbox, just the folders you need)
2) If you are allowed to setup more than one user on the remote server, have a 2nd user and then have user2 session connect rdp session to user1. This will keep the user1's gui alive in the cloud without having to remain logged in to rdp locally.
This video should show you how to implement this 2 user setup on your server to hold an rdp session open. Note that this does 'permanently' use 1 rdp session until you decide to close it.
[markdown cannot embed video :( ]
Then use AmmyyAdmin AnyDesk on user1's desktop to connect and manipulate the desktop. This includes using AnyDesk's file manager's ability to browse any folder you need and copy. AnyDesk can be free if you connect via direct IP connection. Most vps servers have dedicated IP addresss or subdomain address so this should not be a problem. Good idea to password protect your AnyDesk login and which IDs have access to unattended remote connections. The AnyDesk file manager is a bit crude, but it works. Their big thing is simplicity and speed.
Note: Use portable mode only on the remote user's desktop; Do NOT fully install AnyDesk. Also, the CPU usage might increase to stream the desktop screen, somewhat related to the size of the RDP window. I am using 1280 x 2048 window with 4 cores and the CPU usage is 22-25% idle or moving things around. This might decrease if there is more video ram or graphics processor on the target server. But, if you only "browse files" (use only the file manager without streaming the desktop), CPU usage >0.3% idle and >1 avg% when transferring files (burst up to 5-6% when the file is finished uploading and the pieces are being finalized).
You'd have to write your own scripts (java, .net, c#/c++, AutoIT, etc) to launch AnyDesk locally and automate the connecting and downloading specific files.
This strategy is a bit more complex, but it should do the job. Not sure why microsoft rdp cannot have some simple, quick file manager like what ammyy admin AnyDesk has; oh well.
Add: Can also use AnyDesk or Teamviewer. Teamviewer became a lot more restrictive on what is considered to be "non commercial use", but Anydesk is secure, much smaller footprint, and if you can have a direct connection doesn't seem to care too much about usage. If you do need a license, it will be much lighter on the wallet.
AnyDesk works flawlessly without any installation required. In fact, if using in a server environment as I described above, no installation is recommended.
Edit: AmmyyAdmin is no longer recommended for several months now due to some security and technical concerns. Added AutoIT as a scripting capability to automate interaction with GUI/nearly any windows function.

File permission in linux vs. in windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
In linux, if I have a file I'm sharing with a group, and I put the file on a USB memory stick, for example, and copy it to a computer that doesn't have the same group or users, does the file have no permissions for anyone on that new computer? What if I bring a linux file that only lets user X to read it to a windows machine? Who gets to read it on the windows machine? since user X (and group) doesn't exist on that machine.
What kind of security do I get copying a linux file to another linux machine? how about to a windows machine?
What kind of security do I get copying a windows file to another windows machine? how about to a linux machine?
Please let me know.
jbu
Regarding the USB key: generally, USB keys use one of the FAT family of filesystems; FAT doesn't support security at all, so as soon as you copy the file to it the security information is lost. So for your first question, anyone who has the USB key can read it on any computer from any user account. It is possible to format USB keys using another filesystem (for example, NTFS, which does support security); in that case, if the accounts (in Windows, at least, it must be a domain account or similar, just naming two accounts the same will not do it) do not exist on the target computer, only a user who can ignore filesystem permissions (such as root on *nix or Administrator on Windows) will be able to access the file.
For the second, I'm not 100% sure but I believe it depends on how you copy it; things like FTP and rcp generally don't copy permissions over, so I would assume that the file gets some kind of default permissions for the target directory, or a default built into the copy program, depending on what the copy program does.
For windows, to the best of my knowledge the security descriptor is initially inherited from the target folder; permissions are, again, not persisted across machines. It can be modified after the copy.
In general, except in specific environments that are designed to transfer permissions, I would assume that transferring any file from one computer to another resets the security permissions to a default (generally whatever a new file in that location would receive).
as technophile said, removable drives usually use FAT filesystems, so no permission info is copied at all.
on more 'direct' copies between *nix machines, if the writing process is run under root, usually there are flags to preserve permission bits and owner/group. also, most of them preserve user/group identities by the numbers. if there's no 'global' user identity database (LDAP, NIS, or even AD), be sure to look for a 'by name' identity.
some examples:
NFS: assumes 'identity by number', unless you use some 'squash' option to make every file the same owner/group.
cp: the '-p' flag preserves mode, ownership (by number) and timestamp.
scp: the '-p' flag preserves modes, but (usually) not ownership
rsync: only root can preserve ownership (-o,-g, or -p), tries to match usernames, but falls back to userids if not possible.
Why bother with permissions?
They get in the way most of the time unless you are running some sort of server.
Perhaps copy from linux FS to a FAT32, exfat, or NTFS FS so you don't have to deal with permissions?
That is what I do. I usually choose NTFS for file 'sharing' between desktop and laptop where laptop has linux and desktop has windows 7. Cannot easily do *nix laptop to *nix desktop without doing chmod multiple times (and even THAT doesn't guarantee R/W permissions)
When I tried to share between *nix's, everything was quite bad.
I need FULL read/write access by everyone on any box from any external drive.
Only problem with ntfs is if your *nix doesn't write to it or shut it down correctly.
Then I have to use windows to fix it (pain too). Hence one of the reasons I keep windows around.
Every flash and external drive I have are all NTFS except 2 of them which are fat 32 to 100% GUARANTEE no foul ups with linux demanding permissions (which many times I cannot change for some reason even with chmod).
Of course my data is plain old movies music pictures, similar domestic items.
But the same theory holds that if you don't or can't write permissions with the file, anyone should be able to use the file from any operating system.
I have gone so far as to copy a stubborn file onto a fat 32 flash drive just to strip permissions then copy it back. HATE typing command line stuff.
For me I need 100% read, write access to ANY data I have on external drives for all computers.
About using root - most linux 'suppliers' strongly discourage the use of root for doing many things.
Again, easy way around permissions is if you can copy it you can strip it by sending it to fat32. Or ntfs. And there goes the security.
If something is so sensitive that you NEED file security when file sharing then why share it in the first place?
If you want to prevent tampering with a file then burn it to a cd/dvd. That is read only. Even if they copy it and tamper with it the original is still untouched.

How Do You Clone A VM Using VMware Fusion? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
Is it possible to clone a virtual machine using VMware Fusion on Mac OS X? I'm trying the 30 day evaluation version but there doesn't appear to be a clone feature. I tried using the Finder to copy a VM's package structure but the copy didn't appear in the Virtual Machine Library.
Just use File->open to open the copy of the VM. It will probably ask you if you want to change the VM's unique ID. If you plan to run both the original and the clone at the same time, and it's not a Windows OS that needs activation, you should say yes.
In the Virtual Machine Library window select the add button (upper left)
Select "New"
Select "Continue without Disc" button
Select "Use an existing virtual disk:"
browse to where the Vm you want to clone is located. On the bottom half of the screen you have 3 options. To create a totally separate VM select the first one " Make a separate copy of the viral disk" and just follow the instructions.
just copy the folder cp -R folder newfolder (in your docs folder) Open the folder in Vmware and say you copied it Have a look on weblog.jamisburk.org, august 15
as there may be issues with networking
Justin
I don't know fusion in detail, but in VMWare Server you can just copy the files somewhere else.
Here are the instructions on VMware's site:
http://kb.vmware.com/kb/1001524
To copy the virtual machine:
Power off your virtual machine.
Note: Making a copy of a virtual machine while it is running or
suspended can create a copy that may not boot.
Find the virtual machine bundle. For more information, see Locating
the virtual machine bundle in VMware Fusion (1007599).
Drag the virtual machine bundle to the location where you want the
copied bundle to be. If you are copying it to the same folder or
somewhere else on your hard drive, hold down the option key -- this
tells Mac OS to copy the file rather than moving it. If you are moving
the bundle to another drive or a network share, Mac OS copies the file
automatically. The cursor is superimposed with a green circle and a
plus sign, indicating that a copy will be made.
Note: This does not affect your current virtual machine.
If you power
on the copied virtual machine, Fusion asks if you have moved the
virtual machine or copied it. Select that you Moved It (unless you
need to run the copied virtual machine at the same time as the
original). This indicates that it is the same virtual machine, just
starting from a new location, and keeps all of the settings the same.
Note: When you select the Copied It option, a new UUID and MAC address
are generated, which can cause Windows to require re-activation and
may cause network issues.

Resources