how to add hosts via SSH ?

Discussion in 'Jailbreaks and iOS Hacks' started by hectic6, Jul 23, 2009.

  1. hectic6 macrumors member

    Joined:
    Jul 22, 2009
    #1
    Hi,

    I'm working in china and twitter, facebook, youtube is ALL blocked here:mad:

    I been reading some chinese websites that you can SSH and add host to access twitter. -> http://www.weiphone.com/viewthread.php?tid=422274

    this is the instructions given but i have no idea how to add...:confused:

    \private\etc\hosts
    128.121.146.228 twitter.com
    168.143.162.101 assets1.twitter.com
    168.143.162.101 static.twitter.com
    168.143.162.101 assets0.twitter.com
    168.143.162.101 assets2.twitter.com
    168.143.162.101 assets3.twitter.com
    168.143.162.101 assets4.twitter.com

    I just jailbreak recently in order to bypass china firewall to access these sites...Anyone have any good ideas any other ways or programs i can use to access twitter, facebook, and youtube...

    thanks~!
     
  2. hectic6 thread starter macrumors member

    Joined:
    Jul 22, 2009
  3. hectic6 thread starter macrumors member

    Joined:
    Jul 22, 2009
  4. boast macrumors 65816

    boast

    Joined:
    Nov 12, 2007
    Location:
    Phoenix
    #4
    i guess if they just block by DNS requests, then that would work.

    Is it the SSH part, or the editing part you need help with, or everything lol?
     
  5. hectic6 thread starter macrumors member

    Joined:
    Jul 22, 2009
    #5
    Hey thanks for the reply boast!

    I'm a total newbie in jailbreaking, had the iPhone 3G for a year since. But since this year (as I'm working in china), YouTube, facebook & twitter All been firewall. So I'm JB as I read on some Chinese sites that I could add hosts (Ssh) to access Twitter. Above are the instructions but I don't know how to edit them in ssh. Can u help me? Thanks!:)

    Btw, do u know of any other programs or ways I can bypass the firewall to access YouTube & facebook? That would be GREAT!:D

    Thanks!!
     
  6. bytethese macrumors 68030

    bytethese

    Joined:
    Jun 20, 2007
    Location:
    Cranford, NJ
    #6
    SSH (SCP to be exact) is a means to transfer files. You would transfer the hosts file locally, make the changes and copy it back. Fugu is a good Mac app, not sure about Windows.


    As for the Great Firewall of China, you shouldn't need a program, but a proxy server service. There are some out there altho I am not sure but some do have an accompanying application, such as Tor. This only works on your machine however and not your iPhone.
     
  7. boast macrumors 65816

    boast

    Joined:
    Nov 12, 2007
    Location:
    Phoenix
    #7
    whelp, first you want to turn on wifi, and openssh, and connect to your local network.

    Next you will want to get the IP address of the device. You can check your settings to see the IP it was given, or use sbsettings on your device which tells you the IP address.

    Third, you want to open Terminal on your mac. Then you type
    Code:
    ssh ipAddress -l root
    editing the ipAddress part with, you know, the IP lol. It will ask about some authenticity, say yes. Then it will then ask you for the password. And it should be "alpine" unless you have personally changed it.

    Fourth, type in
    Code:
    nano /private/etc/hosts
    which will open up an editor. Paste all those address things on there. You use "ctrl + o" to save it, and then "ctrl + x" to exit nano.

    Then type in "reboot" and hope it works. :)
     
  8. hectic6 thread starter macrumors member

    Joined:
    Jul 22, 2009
    #8
    hey thanks the help boast!

    but its didn't work...i found the hosts file in when i SSH in iphone -> private/etc

    and i use MS word to add in these under the last line ->

    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost
    255.255.255.255 broadcasthost
    ::1 localhost
    fe80::1%lo0 localhost
    202.106.1.2 www.facebook.com
    128.121.146.228 twitter.com
    128.121.146.228 www.twitter.com
    128.121.146.101 assets0.twitter.com
    128.121.146.101 assets1.twitter.com
    128.121.146.101 static.twitter.com
    128.121.146.229 assets2.twitter.com
    128.121.146.229 assets3.twitter.com
    65.74.185.41 twitter.zendesk.com
    65.74.185.41 help.twitter.com
    203.208.33.100 www.youtube.com
    203.208.33.100 gdata.youtube.com
    128.121.146.228 twitter.com
    203.208.39.104 wlfs.blogspot.com
    203.208.39.104 www.bogger.com
    203.208.39.104 www.youtube.com
    203.208.39.99 upload.youtube.com
    203.208.39.99 insight.youtube.com
    203.208.39.160 help.youtube.com


    did i add it wrongly? doesn't seem to work...

    thanks!
     
  9. dZp macrumors 6502a

    dZp

    Joined:
    Mar 29, 2006
    #9
    Whoa! Talk about overkill! Try using a plain text editor. TextEdit on the Mac, Notepad on Windows.

    So what exactly happens?
    And you do not that all those 203.208.39.x IP addresses are for Google, right?
     
  10. hectic6 thread starter macrumors member

    Joined:
    Jul 22, 2009
    #10
    i Tried all on my windows laptop, doesnt seem to work...i think ALL IP HOSTS are block by the Great China Firewall now...:mad::mad:

    Seems my only way is to set up a VPN ....:eek:
     

Share This Page