Unix FTP and remote login help??

Discussion in 'Mac Programming' started by kashmoney2006, Jan 5, 2008.

  1. kashmoney2006 macrumors regular

    Joined:
    Dec 12, 2007
    #1
    So ive just recently been reading and learning about Unix and the ability to access my computer when i am away from it is intriguing. Can anybody give me some insight on how i would go about this?
     
  2. Eidorian macrumors Penryn

    Eidorian

    Joined:
    Mar 23, 2005
    Location:
    Indianapolis
    #2
    Those services can be enabled in the Sharing Preference pane.
     
  3. kashmoney2006 thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #3
    yea i enabled both of those but im confused what to do from there? i tried the personal web sharing by entering http://[I]my_IP_here[/I] but it didnt work how i expected it to. it didnt connected me to my computer? although i was trying to access from the same computer, as i dont have access to another one at the moment. does that matter?
     
  4. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #4
    Do you have a fire wall? If you do you are going o have to open up the http the ftp ports and any others you need. Try http://localhost and see if that works better.
     
  5. kashmoney2006 thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #5
    So heres what i get. is this normal??
     

    Attached Files:

  6. Eidorian macrumors Penryn

    Eidorian

    Joined:
    Mar 23, 2005
    Location:
    Indianapolis
    #6
    Did you expect something else?

    Unless you've already added your own pages.
     
  7. kashmoney2006 thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #7
    i didnt really know what to expect actually. the book just made it seem like i would automatically have web access to all my files. how do i add pages? could you provide me with a link or something explaining it a little more. Thanks!
     
  8. Eidorian macrumors Penryn

    Eidorian

    Joined:
    Mar 23, 2005
    Location:
    Indianapolis
    #8
    I'm trying to dig up some documentation on how Apache in OS X handles web hosting.

    http://kb.iu.edu/data/algt.html

    This might still be relevant. Building a web site in ~/Sites should be an option as well.
     
  9. kashmoney2006 thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #9
    Ok i think i understand it a little bit more. I need to build an html file and then i can display it through web sharing?? I thought that i would be able to some how view/download my files, like i would be able to in finder but through the internet?

    when clicking on the link for my personal web site i get this.. How do i get permission?
     

    Attached Files:

  10. linuxophile macrumors regular

    Joined:
    Nov 8, 2005
    Location:
    here
    #10
    Logging in

    Hello,
    I think you want a step-by-step guide.

    1) turn on Remote Login in Sharing (you have already done probably).

    2) now you can log in from any unix/mac/windows using a ssh/scp terminal and browse your files. On a mac you can use a graphic frontend for scp called Fugu (free, maybe there are other options). On windows you can use WinScp (free), on Linux I forgot but probably gftp.

    You will need
    a) the IP of your machine
    b) your username
    c) your password.

    Of course you can just use Terminal and
    ssh username@IP_OF_YOUR_MACHINE to log-in
    or
    scp username@IP_OF_YOUR_MACHINE:remote_file local_file
    to transfer files

    NOTE: if -like me- you must access your home computer from outside and you have DSL you need extra steps to ``find'' it from outside (unless you have static IP)
    In short: subscribe to a dynamic dns service (www.dyndns.org, free) and install the appropriate daemon to keep your ip updated (I have dnsupdate)
    Configure the firewall on your router (if any) to let through traffic on port 22 to the local IP of your PC at home.
    You will then have a regular pseudo-domain like
    mymachine.dyndns.org to which you can connect from anywhere. If you need a web server you need to let through traffic on port 80 as well.
    Good luck and have fun.
     
  11. kashmoney2006 thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #11
    I am using an airport base station to receive my internet wirelessly throughout my house. in order to have a static IP can i just use the setting "Using DHCP with manual address" and set a specific IP in the network preferences pane? or will this not work? Thanks for your help!
     
  12. titaniumdecoy macrumors member

    Joined:
    Oct 13, 2005
    #12
    Unless you pay an extra monthly fee (~$5/month), you have a dynamic (rather than static) IP, which is assigned to you by your ISP and changes every so often.
     
  13. sord macrumors 6502

    Joined:
    Jun 16, 2004
    #13
    No, linuxophile is referring to your ISP given IP. You cannot change it, and it is either static or given via DHCP from your ISP to your router.

    Take a look at dyndns.org, its free and will allow you to get a free DNS that will update itself to your ISP given IP.
     
  14. WildPalms macrumors 6502a

    WildPalms

    Joined:
    Jan 4, 2006
    Location:
    Honolulu, HI
    #14
    Can you be more specific with what you want to achieve please.

    Do you want remote desktop access where you can remotely control your Mac?

    Do you want file access via a web browser specifically?

    Do you want to access your web site located on your Mac?
     
  15. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #15
    Your original question is regarding FTP. So far I haven't seen anyone really help you achieve this. Note: Web sharing is for hosting a web page from your home IP, not really necessary IMO (in this case).

    You need an FTP program (Transmit, Cyberduck, Fetch, etc.)
    FTP Sharing Enabled
    Your World IP (if outside your home network) (www.whatismyip.com)
    (Optional) Ports forwarded (if you want multiple computers accessible).

    Ok, just go into your FTP program dial in your IP address (local or world) and put in your user account login/pass. You should see your home folder show up.

    EDIT: If you want to access your computer through the UNIX terminal, then you need to lookup SSH which is a bit messier then FTP. Remote file transfers aren't as easy this way, though more secure (again IMO).
     
  16. guitarmaster18 macrumors regular

    guitarmaster18

    Joined:
    Mar 27, 2007
    #16
    You could do this a couple of ways.

    Way #1: Ftp. Probably the easiest. Go into System Preferences and check the "Ftp" box. It will give you the info that you need to input into your FTP client (CyberDuck, etc.)

    Way #2: Ssh. This is the best if you know UNIX. If not, then stay away from it. I prefer it over FTP because it does not only give me File system access, it also gives me access to execute commands remotely (The say command is just TOO much fun :p).
     
  17. linuxophile macrumors regular

    Joined:
    Nov 8, 2005
    Location:
    here
    #17
    As pointed out by someone already, dynamic or static IP (given by your ISP) depends on the contract you have. You can't do anything to change it, short of changing the contract.

    And for FTP (mentioned by someone else), it is not any easier than the other methods and MUCH more insecure (passwords are sent in clear, anyone can sniff them and bye-bye privacy). If you insist, however, the only things that changes is the port that need to be open (20 if I remember correctly).

    Configuring the firewall of your airport should be covered in the manual: I do not have one, so can't help, but there must be an interface to it (probably through your browser by typing the local IP of the base). Note that in the firewall configuration you must be sure that the LOCAL IP of your computer (connected by WiFi) is STATIC (in the DHCP configuration of the base): this is NOT the IP of your modem (which is Dynamic, i.e. changes from time to time or any time you reboot it).

    Your DSL(cable) modem has an IP (assigned by the ISP) which is the ``public'' IP, the one ``visible'' from the outside network: it is attached (I imagine) to the airport. This latter re-routes the traffic to the local network (LAN) in your home, consisting of the airport base and all computers attached wirelessly or wiredly to it.
    The base also decides which local IP (typically starting 192.168.xx.xx) to assign to each computer. This assignment is also dynamic (i.e. pretty much random) unless instructed otherwise.



    As for programs Fugu is oldish but works well and is (reasonably) intuitive: it is simply a GUI to scp (which has the same function of ftp but uses encryption).

    If you feel adventurous, install a VNC server (OSXVNC).
    After configuring appropriately the various ports/firewalls (along the same logic behing ssh/scp) you will be able to share the desktop remotely using any VNC client (e.g. Chicken of the VNC). I tried but frankly never got much use for it.
     
  18. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #18
    Its port 21 for FTP (22 for SSH).

    How is it not easier? Using the Terminal (SSH) for transferring files requires a general knowledge of UNIX which isn't exactly common sense. FTP is much easier, and using SFTP is secure.
     
  19. linuxophile macrumors regular

    Joined:
    Nov 8, 2005
    Location:
    here
    #19
    Because he is not interested in logging in (with ssh) but -as I understand- only in transferring files. You do NOT NEED the terminal to use scp (which is encrypted file transfer). As I said, Fugu is drag-n-drop, graphical interface.

    As for sftp, in point of fact Fugu can use that as well.
    I think the message here is to AVOID FTP (sftp is ok scp is ok).

    If you want to CONTROL your mac remotely (having it doing stuff) your only options are terminal+ssh (AVOID telnet) (very lean but unfriendly solution, works even using dialup) or vnc (very heavy, requires broadband on both ends) (or any other proprietary Apple desktop sharing solution).

    Learning to use the Terminal has its own advantages:
    1) showing off with your friends;
    2) can be used to/from any Unix system (as many universities)
    3) much fine-grain control. For example, if you open port 22 in your firewall and wait a couple of days, then look at the secure log (using Console.app). You will see tens of attempted intrusions using random usernames. Not really dangerous but still irritating.
    Solution? (well not really, but cuts down significantly) Change the port where ssh (or sftp) works. To do that I think you must use the terminal and go into the appropriate configuration files. I could not find any way to do that using the GUI in system preferences.
    4) to navigate your filesystem you need only a handful of commands
    ls (directory listing), cd (change directory), mv (move), rm (remove), cp (copy). If you use TAB completion, you can navigate a tree faster than using the Finder+mouse (not as pleasant, though, especially if you use Leopard)
    5) Sometimes there is just no other option but use Terminal (of course this assertion depends on what you need to do).

    6) Terminal is ecological/environmental friendly; it's like riding your bike instead of taking your Hummer.
    7) Terminal is sexy; look at that wink in the icon!, at those square corners. You gotta love it.
    8) Terminal is cool.
    9) Don't even get me started on X11!
     
  20. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #20
    You definitely chose the right SN for yourself haven't you.
    (ecological friendly??? that's a stretch)
     
  21. kashmoney2006 thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #21
    So im trying to figure out dyndns. it seems as though it is giving me my local ip and not my public ip. it says my registered ip as 10.0.1.201 which i set up for my static local ip. whatismyip.org shows 67.181.44.229. what am i doing wrong??
     

    Attached Files:

  22. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #22
    You know most ISP's give you static IP addresses unless you renew your DCHP license manually. What are you doing with DynDNS? What are you trying to do at all really? You already have all the tools you need to remotely access your computer.
     
  23. kashmoney2006 thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #23
    Well from what people above have said, i need my IP that my ISP has assigned. and from what has been said so far, this changes periodically and dyndns is supposed to tell me this IP and update it as it changes. am i right?
     
  24. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #24
    True. Though I would get the FTP and all working before you get too complicated. Not to say DynDNS is crazy complicated but it sounds like you have enough on your plate at the moment. Your IP doesn't change that quickly. Generally cable modems have more permanent IP's where DSL tends to change a bit more.
     
  25. kashmoney2006 thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #25

    Ok so from what i understand FTP is very unsecure, and SFTP is much better. If im on another Mac not within my local network how do use SFTP within terminal to access my computer? that is, what would follow the sftp command in terminal?
     

Share This Page