0

This question is based on this question.

I have two Macbooks in the same network. Both computers get the internet from the network.

I guess that I can share files between the two Macs without Internet.

I have tried to put files to the folder /net/localhost/ but I get

localhost: Operation timed out

when I try to copy a dummy file there.

The same problem is in both Macs. This suggests me that I do something wrong.

How can you share files between two Macs in localhost?

  • 1
    /net/localhost is not what you want - /net is used to mount NFS servers. 2 (recent) Macs connected to the same local network should be able to see each other and share files via Bonjour and AFP as explained by msanford. If you cannot even ping the other Mac, there must be some basic connectivity problem. Could you describe your network setup in a bit more detail? Are there any other computers besides the 2 Macs? – Marie Fischer Jul 08 '09 at 23:29
  • @Marie: There is no other computers of mine besides. --- There is at least 10 computers of other people at my area. – Léo Léopold Hertz 준영 Jul 09 '09 at 15:35

3 Answers3

4

I don't understand what you mean by sharing files in localhost, since localhost is by definition the local machine. What are you attempting to do with /net ? Is it an NFS mount-point?

To enable file sharing in OS X, go to the Apple menu (top left of every screen) and select System Preferences > Sharing, and enable File Sharing on the target machine (i.e., on both machines if you want to share files bilaterally). Note that this is AFP, the Apple File-sharing Protocol, not NFS.

Then, in the Finder, type Shift-Apple-K and you should see your other computer(s) in the LAN, including accessible Samba/Windows shares. You will need to connect either to shares you have made publicly-accessible, or to connect using an authorized user account on the local machine (just like ftp: you have anon and local users).

msanford
  • 1,427
  • 15
  • 27
  • 2
    PS Upon re-reading this post, I notice that you have pasted what looks like a shell response ("localhost: Operation timed out"). What *exactly* are you doing to copy the files: scp, rsync, cp…? – msanford Jul 04 '09 at 02:28
  • @msanford: I am trying to `cp`. – Léo Léopold Hertz 준영 Jul 04 '09 at 10:28
  • So to 'copy the files to the network', you must be trying to do it to an NFS-mounted share? – msanford Jul 04 '09 at 21:30
  • PS Check this out, just pulled it from FOSSLC http://fosslc.org/drupal/node/460 – msanford Jul 05 '09 at 03:42
  • @msanford: Thank your the link! ---- It seems that it is easier to share files over ssh. – Léo Léopold Hertz 준영 Jul 09 '09 at 15:42
  • 1
    Even on my LAN, with a wired connection, I often use ssh/scp to copy files between hosts because it's what I'm most familiar with and scp is very easy to use. It also keeps me in the habit of always using a secure copying tunnel, so pushing files to remote hosts is also secure by instinct (for lack of a better expression). – msanford Jul 10 '09 at 18:48
  • @msanford: Do you mean that you can copy files with SSH between two computers without Internet? --- How can you get the IP address of other computer such that you access it by SSH? – Léo Léopold Hertz 준영 Jul 12 '09 at 20:03
2

A Quick way to share files is also to just put the files in the Sites Directory of your user and enable Websharing in the Sharing tab of the System Preferences, now you can just surft to your mac and download the files (something like http://YOURMAC.local/~USERNAME/file.txt )

Sideshowcoder
  • 513
  • 2
  • 8
  • @SideShowCoder: I cannot see the site of MacA at my MacB which is in the same network. That is we both use the same network which gives us the Internet. – Léo Léopold Hertz 준영 Jul 04 '09 at 10:39
  • 1
    @Masi - Can you ping the other Mac using ping and the IP address? If so, check the firewall and if it's not showing up via Bonjour then you may not have mDNSResponder running (which is by default) – Chealion Jul 04 '09 at 16:28
  • 1
    Check if you can ping via IP should be the first thing, Check your IP vai Network Utility for example you can ping from there, too. If you can ping, try putting a file named index.html with just "test" for example in it in your Users Sites directory and try Access like http://YOURIP/~USERNAME If you enable Webshareing via the Sharing tab in the Sys Pref the firewall should be ajusted by itself. – Sideshowcoder Jul 04 '09 at 19:15
  • I cannot ping the other Mac. – Léo Léopold Hertz 준영 Jul 04 '09 at 22:03
1

In the Finder, select 'Help', then search for 'Sharing files on your network'. Follow the instructions. This will turn one of the machines into a server, then on the client, select 'Connect to Server...' from the Go menu. You should be all set.

Joel
  • 175
  • 1
  • 6