Connection Between two Macs..Different Countries

Discussion in 'Mac Basics and Help' started by Macintosh001, Nov 23, 2007.

  1. Macintosh001 macrumors member

    Macintosh001

    Joined:
    Nov 2, 2007
    Location:
    España
    #1
    HEY!I have been trying to connect my computer to another one in another country to get some data but I can't,they are both Macintosh.The problem is that because we don't have a permanent IP we don't know how to do it...sounds as If we have no idea...maybe is that.What happens is that we have tried using sftp ,terminal and all sort of things that popped up in our minds..but we just can't and sending it all through mail is just impossible.I know you know the answer and would be very glad If you share it with me and help me solve the problem and learn more(you never know enough about macintosh):rolleyes:
     
  2. thewhitehart macrumors 6502a

    thewhitehart

    Joined:
    Jul 9, 2005
    Location:
    The town without George Bailey
    #2
    You have a number of options.

    First of all, if the mac you're trying to connect to is behind a router, you need to map the specific port you want to access from your WAN IP address to your mac's internal IP address. For instance, if you wanted to remote login to the mac using ssh (Remote Login in Leopard and Tiger Sharing Preferences), you'd need to map port 23 on your public IP address to port 23 on your mac's private IP address. This can be done through whatever method you use to set preferences for your router.

    If you have a dynamic public IP address (one that changes somewhat frequently as assigned by your ISP) you should check out DYN DNS. They have a free service that maps a permanent address to a dynamic IP, by using software on the server mac that keeps track of its changing public IP address.

    Another new method offered by Apple is "Back to My Mac", only on Leopard. However, you need a .mac account to take advantage of this. It uses your .mac account and some sort of public / private key authentication method to keep track of your server mac. You just have to have 'back to my mac' enabled on all the macs you want to connect between, and your .mac account set up on each one. I have yet to try this.

    Using remote login via the terminal is a surefire way to go. Just make sure the server mac is always on, or not asleep when you want to access it. You have to have the ports mapped. The mac's firewall, if enabled, should automatically let remote login requests through when you check the box in sharing preferences. You also may have to configure any firewalls you have between your client and server mac to allow ssh traffic.
     
  3. ab2650 macrumors 6502a

    Joined:
    Jun 21, 2007
    #3
    He and you can get your current IP address' from DSL Reports Tools.

    To share files via SFTP, turn on "Remote Login" in System Prefs > Sharing. You'll either need to give out your login/password (bad idea) or create another user for your friend to log in as. You can then SSH or SFTP/SCP to the remote machine.

    Make sure on the router on the computer accepting connections that you've opened up port 22 and mapped it to it's applicable internal address. For instance, this scenario:

    Your external IP address: 1.2.3.4
    Your friend's external IP address: 5.6.7.8
    His internal IP address: 192.168.1.100

    He would need to:
    1) Configure his router to pass all TCP traffic on port 22 to 192.168.1.100, port 22.
    2) Turn on Remote Login.
    3) Create an account for you and tell you the username password.
    4) Put the files somewhere your user has access to, like in your /Users/username/ directory (home).

    You would then:
    1) SSH (or SFTP/SCP) to 5.6.7.8 on port 22 (standard) and use the username/password he supplied for you.
     
  4. Macintosh001 thread starter macrumors member

    Macintosh001

    Joined:
    Nov 2, 2007
    Location:
    España
    #4
    Ok..I don't think I know how to map the router to pass all TCP traffic to whatever port....
     
  5. MikeTheC Guest

    MikeTheC

    Joined:
    Apr 26, 2004
    Location:
    Gallifrey -- Capitol City, Prydonian Sector
    #5
    The exact "how" varies from router to router, since their firmware-generated web page setup menus are different.

    In general, there's going to be an entire section devoted to such port mapping customization. Look for that. What you need should be there.

    I personally use dyndns.com's services for my own web server, which I have set up essentially exactly as is being discussed up-thread (with the obvious exception that it's a web server, open to public access, and isn't encrypted).

    FWIW, it's running on a PowerMac G3/300, which is in turn set up with Debian Etch, and naturally is using the Apache web server.

    URL: Armageddon The Series

    Ok, yeah, it's a shameless plug. But then I have been told I sometimes have no shame. Aw...
     
  6. ab2650 macrumors 6502a

    Joined:
    Jun 21, 2007
    #6
    What router type and model do you have? On my Linksys, it's under the "Applications & Gaming" section then "Port Forwarding". You're essentially telling the router than connectings on "whatever" port should be sent to a specific computer inside the network.
     
  7. Macintosh001 thread starter macrumors member

    Macintosh001

    Joined:
    Nov 2, 2007
    Location:
    España
    #7
    Ok in my router is the same in "Applications & Gaming".Ok I think I know how to do that...but what ports do I need to open??I think that is the only question resting
     
  8. ab2650 macrumors 6502a

    Joined:
    Jun 21, 2007
    #8
    If you're following my instructions, then it would be port 22.

    It sounds like you have a linksys router. On mine, the fields are:
    Application | Start | End | Protocol | IP Address | Enable
    You would have them filled out:
    SSH | 22 | 22| TCP | [your.internal.ip.address] | Checked

    Your friend should be able to open a SSH/SFTP/SCP connection to your external IP address (the one you get from dslreports or the status screen of your router.)

    Remember, unless you trust your friend with the ability to erase everything on your computer, make a new username/password for him to log in as.
     
  9. Macintosh001 thread starter macrumors member

    Macintosh001

    Joined:
    Nov 2, 2007
    Location:
    España
    #9
    Hey thanks ..I have finally made it..the only problem I have now is that I don't know how to copy data to my computer ,because I don't know how to name my computer...sounds simple,but you have got to be so precise in Terminal that I can't.But well I'll figure it out
     
  10. ab2650 macrumors 6502a

    Joined:
    Jun 21, 2007
    #10
    Great to hear the connection worked. You can use any SCP/SFTP program to transfer files; You could do it on the command line, but it's a mountain of text to type to copy just one file. (hint: make archives!)

    But I would recommend going and getting Transmit and use it for a trial. If you like it (it's nice!) it's $30. There are a billion other SCP clients out there too, but Transmit is pretty slick.

    If you really want to do it via the command line, here's the steps:
    1) (optional) On the remote machine via ssh, archive all the files you want to transfer together so that you only have to transfer one large file. Use "tar -czf archivename.tgz file1 file2 file3"
    2) On your local machine in terminal, type: "scp username@friends.external.ip.address:/path/to/filename /path/to/local/where/to/save/"

    When in trouble, type "man scp" to get the manual page for scp. Same goes for "man ssh".

    Finally, if you're interested in doing passwordless logins (it's called public key/private key, or PKI) let me know; It makes it easier if you'll be connecting many times, or automating connections.

    HTH!
     

Share This Page