43

Is there any links/tutorials/videos that helps me share files between Ubuntu and Mac OSX?

htorque
  • 66,086
bragboy
  • 904

14 Answers14

24

Setup a Samba Server in Ubuntu

In OSX:

  • Open a finder window and hit cmd-K
  • Type 'smb://ipAddress' where 'ipAddress' is your ipaddress
  • Select the share you're connecting to (as per the samba setup)
  • Authenticate
  • It should mount the share the same as it mounts anything else

In Windows:

  • Configure your firewall to allow smb connections if it doesn't already
  • Open Start->Run
  • Type '\ipAddress' where 'ipAddress' is your ipaddress
  • Authenticate
  • Under the 'Network Places' folder the shared folders should appear

Here's a really long drawn-out explanation for windows including how to setup the server in *nix.

Samba is basically Windows NFS (Network File System) that is completely cross platform and easier to setup/use.

Note: There is a GUI tool for configuring Samba but I can't remember how to access it off the top of my head. Also, I think you can connect to Samba in OSX under connect-to (or something similar) from the top bar menu but I can't remember exactly what it's called since I haven't used a mac in over 6 years.

IMHO, this method is a lot easier and straight forward to use than FTP because it mounts the remote folder as if it's a local folder on your system. It doesn't get much more transparent than that.

Evan Plaice
  • 1,966
15

A bit of Google-fu found a guide for Ubuntu 10.04 (Lucid) and Mac OS X. I haven't got a Mac handy to test on, so haven't tested it.

Boken
  • 103
  • 5
8128
  • 28,868
9

I accomplished this by doing the following:

I have a Mac OS 10.4 (Tiger) on a G5 PowerPC and Ubuntu on an Acer Aspire One.

  1. In mac OS, go to system preferences>sharing and enable "Personal File Sharing"

  2. In Ubuntu open DashHome and open "Files" folder. (or however you know how to get to the files folder.)

  3. In the sidebar, choose "Browse Network"

  4. As long as the two machines are on the same network, your mac should be in there as a directory that you can mount within Ubuntu.

I had very little idea what do do, having only ready this page, and it turned out pretty easy. It works for me, sharing files within a home office. It wouldn't work if you need to work remotely because you would be off your own network.

phil
  • 91
4

so many answers and none correct, using SAMBA is ridiculous, SAMBA is poor mans version of NFS, NFS is the way to go, it's native to almost all unix distributions and its faster and better than SAMBA which is only popular because windows doesn't talk NFS, if you want all three to share (win, ubu, mac) then yes, SAMBA, if just mac and ubuntu, their native share option is nfs.

Sometimes comes installed with the OS, if not sudo apt-get install nfs-kernel-server (or brew) for a full tutorial go here

3

HTTP server

HTTP is the protocol used to access regular websites, so every OS was forced to implement it!

Find your IP on the source computer, e.g. 192.168.0.10. On Ubuntu or Mac OS:

ifconfig

Create a server in a directory that contains the file you want to transfer:

python -m SimpleHTTPServer 8080

On the receiving computer, open a browser, and visit:

192.168.0.10:8080

Now you can navigate through directories to the file you want.

I'm not sure if this method is fast / robust, but it is one of the simplest to setup and portable.

Faster alternatives are discussed at: https://stackoverflow.com/questions/12905426/what-is-a-faster-alternative-to-pythons-simplehttpserver

rsync

SSH works really easily on MacOS and Ubuntu, and so we can very easily use Rsync.

First make sure you can SSH from one computer to the other.

You can enable the MacOS SSH server from the CLI as explained at: http://osxdaily.com/2016/08/16/enable-ssh-mac-command-line/

sudo systemsetup -setremotelogin on

Now, from you Ubuntu make sure you can access the Mac:

ssh osx-username@192.168.0.10

You can create a new account for the user if you want to keep your password private.

Then, once you managed to login, to copy files from the server to client just do:

rsync -av server-username@192.168.0.10:/full/path/to/remote/directory .

Multiple directories can be copied in one go as explained at https://unix.stackexchange.com/questions/308810/copying-multiple-files-using-rsync-over-ssh:

rsync -av 'server-username@192.168.0.10:/full/path/to/remote/directory "/full/path/to/remote/directory with space"' .

This is the lowest common denominator method: most robust, efficient, widely Linux available and security relies on well known file permissions + user schemes.

Tested between Ubuntu 18.04 and Mac OS 10.13: "High Sierra".

3

I am on Ubuntu 14.04 My aim is to share all external device which registered under /media (e.g. external hdd, enternal optical drive) with my Mac OS X (yosemith)

On Ubuntu, Open a Terminal windows

$sudo nautilus

Enter your root password when prompt

A nautilus window will be opened, browse to system /media

Right click an choose Properties. Click Share. Click Guest Share. Apply changes.

On Mac Os X, Open Finder, Click Go to server Command + K Enter the Ubuntu IP and click Guest

Ravan
  • 9,567
2

Samba works well in my setup, a home network with three Macs and a server running Ubuntu (since 9.04, currently at 10.10). The Ubuntu machine automatically shows up in the Finder along with the other Macs.

I followed this install guide for the Samba setup. The guide is for Ubuntu server, but it's the same setup and it works the same for the desktop version.

The only change I made was to set the "create mask" to 0777 ("world writable") instead of 0755, otherwise creating folders on the Ubuntu machine from the Macs didn't work properly.

j-g-faustus
  • 5,678
1

Building on what's been said already, I was able to share files from Ubuntu to Mac just by right clicking the folder I want to share and enabling sharing.

user1974
  • 765
1

If you have a secure local network, it's really the easiest and most reliable, to use an ftp server, also accessible from almost any platform, if you happen to have visiting windows users etc.. https://help.ubuntu.com/10.04/serverguide/C/ftp-server.html

Also most media devices will be able to use ftp if it ever comes to that.

To connect to an ftp server is really simple from a mac http://www.youtube.com/watch?v=GNP48LcNV0Y If you really need to write to the ftp from the mac (finder fails and mounts as read only) check. http://anoved.net/2008/03/macfuse-ftp-and-you/

Hellola
  • 566
0

There are possible modern solutions that use HTML5 network discovery for this. You simply need to:

  • be on the same network
  • use a modern up-to-date browser

The only free platform that allows this to my knowledge is ShareDrop, if anyone has any others feel free to add it.

0

In Catalina (10.15) the first thing to do is enable SSH:

$ sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

Then open System Preferences > Sharing > Remote Login. From there you will see your IP (say 192.168.0.102)

Finally you can use rsync (recommended) or another copy command from the destination CLI:

rsync username@192.168.0.102:~/file /destination/
alemol
  • 221
0

If you want a simple type of sharing, you could use Teamviewer, Skype or Yahoo Messenger + gyache in both machines.

Then you could send the file you want. However, this method is relatively slow.

Mateo
  • 8,152
0

I figured out a simple way to connect Ubuntu 13.10 to my imac OS X.

  1. First, I disconnected Wi-Fi on both computers because I wanted to transfer masses on data on cable Ethernet.
  2. Then just plug the Ethernet cable directly between both computers. OS X automatically connects to Ethernet (light turns green in network preference pane on Ethernet). It automatically gives you the IP address and net mask.
  3. Then, in Ubuntu should appear an auto eth in network connections.
  4. Edit this connection by going to ipv4, put on manual, add address (enter IP address and net mask, leave gateway empty, just click in it and leave it to zero, I want to be able to save).
  5. Then check the "require ipv4 addressing...." at the bottom. I left everything else untouched in the connections edit.

Then it worked, both computers connected. But to access the folders on my mac, it didn't work immediately, I had to wait a bit. But then it all worked! and now I'm transferring files at 23 mb/sec.

have fun

Lucio
  • 19,191
  • 32
  • 112
  • 191
0

Very useful, and quite simple, for sharing files and directories between Mac and Linux (and many other platforms) is Syncthing. I use it to share folders from my Macbook Air to Linux Mint. If you want to do a one-way sync set your source folder as "Send Only" in advanced settings for that folder so that files deleted on the receiving computer's folder are not deleted from the source computer's folder.