1

I own linux machine A and have a limited access to linux machine B. Both machine have Internet access.

Internet access on machine A is partially censored so I want to make a SOCKS proxy tunnel through machine B.

Since I cannot forward ports opened on machine B (which is behind a router) so I decided to make a reverse SSH connection from B to A as described here.

However it seems I cannot use SSH on machine B as normally:

$ ssh #on machine B
No user exists for uid 57521
$ whoami
whoami: cannot find name for user ID 57521

My situation is like this one.

Each time I log into machine B, my UID will change. After some research, it seems I probably logged in machine B as LDAP user or something alike.

I don't have write access to /etc on machine B. How do I setup SSH in this case? Or is there any alternative method setup a reverse SOCKS proxy, preferably encrypted?

0

I didn't manage to setup SSH at the end, however I found the tool ssocks suitable for my need, although lacking a bit encryption.

  1. Download ssocks from the Sourceforge link. Then execute:

    tar -zxvf ssocks*.tar.gz
    cd ssocks-*; ./configure
    make -j4
    
  2. Now, in ssocks-*/src/ directory, there should be a client rcsocks and a server rsscoks. Copy rssocks to machine B

  3. Execute the following:

    on machine A:

    ./rcsocks -p <relay_port> -l 1080

    on machine B:

    ./rssocks --socks <ip_of_machine_a>:<relay_port>

    Fill in <ip_of_machine_a> and <relay_port> as per need.

  4. The socks proxy is now available at 127.0.0.1:1080 on machine A.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.