user840930
user840930

Reputation: 5578

How to set up remote access on a Mac?

I need to work remotely and need to connect to a company network from my work Mac over the internet. How do I set this up? I have looked at different software for example OpenVPN and Tunnelblick. But not sure how to go about it. Any suggestions? Advice?

Upvotes: 1

Views: 1467

Answers (8)

WaughWaugh
WaughWaugh

Reputation: 1032

Since you are going to connect to your company network, I suggest you configure a VPN server and client to do that. I have configured the OpenVPN community edition to do that. The steps are:-

Server side configuration

 - Login to root - sudo su
 - Install OpenVPN and Easy-RSA - apt-get install openvpn easy-rsa
 - Copy the server.conf from samples to /etc/openvpn - gunzip -c
   /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz >
   /etc/openvpn/server.conf
 - Edit server.conf
 - Check that Diffie-Hellman is set to 2048 - dh dh2048.pem
 - Uncomment push "redirect-gateway def1 bypass-dhcp"
 - Uncomment push "dhcp-option DNS 10.0.2.100" or put any other DNS
   server you want - default settings is OpenDNS.
 - Setup IP forwarding echo 1 > /proc/sys/net/ipv4/ip_forward
 - Also, edit /etc/sysctl.conf, and set "net.ipv4.ip_forward=1" after
   uncommenting the line. This is for persisting the ip forwarding when
   you reboot.
 - Setup ufw (Uncomplicated Firewall - this is a frontend to iptables)
     - ufw allow ssh
     - ufw allow 1194/udp
 - Edit /etc/default/ufw and set DEFAULT_FORWARD_POLICY to ACCEPT.
 - Edit /etc/ufw/before.rules  and add the following lines near the top
   *nat :POSTROUTING ACCEPT [0.0]
   -A POSTROUTING -s 10.0.8.0/8 -o ens4 -j MASQUERADE COMMIT ufw enable
 - Do a ufw status and check if the rules are setup properly
 - Setup the RSA keys
     - cp  -r /usr/share/easy_rsa/ /etc/openvpn/
     - mkdir /etc/openvpn/easy-rsa/keys
     - Edit /etc/openvpn/easy-rsa/vars and change keys KEY_COUNTRY  etc, and
   KEY_NAME="server"
     - Generate the Diffie-Hellman PEM file - openssl dhparam -out
   /etc/openvpm/dh2048.pem 2048 cd /etc/openvpn/easy-rsa/
     - .  ./vars
     - ./clean-all
     - ./build-ca
     - ./build-key-server server
     - cd keys && cp server.crt server.key ca.crt /etc/openvpn
 - At this point your /etc/openvpn should contain server.key,
   server.crt, ca.crt and dh2048.pem
 - Start OpenVPN - service openvpn start

 - Generate client config
    - Copy client config from samples -  cp
   /usr/share/doc/openvpn/examples/example-config-files/client.conf
   ~/client/client.ovpn
    - Generate the client keys - cd /etc/openvpn/easy-rsa && ./build-key
   client It will generate client.crt and client.key files.
    - Copy client.crt, client.key, ca.crt to ~/client.
 - Edit client.ovpn 
    - Edit the entry "remote my-server-1 1194" and put the
   IP/Hostname of the VPN server in place of my-server-1.

    - At the end, append "auth-user-pass"

    - In a new line, add an opening tag <ca>.

    - Append the contents of /etc/openvpn/ca.crt.

    - Append a closing tag </ca>.

    - Append opening tag <cert>.

    - Append contents of client.crt.

    - Append a closing tag </cert>.

    - Append a opening tag <key>.

    - Append contents of client.key.

    - Append a closing tag </key>.

    - Comment out keys "remote-cert-tls server" and "tls-auth ta.key 1"

    - Uncomment "user nobody" and "group nogroup".

 - Save the file and download to your Mac client securely.

Client side configuration

Upvotes: 0

Arefe
Arefe

Reputation: 12397

I was in the same situation as you a few months earlier and used the Tunnelblick in the Mac OS, which worked perfectly fine.

Upvotes: 0

oles
oles

Reputation: 176

First of all, what type of control do you need? If we're talking about files and stuff like that then you should run a SSH server on your mac. More about that here (stackoverflow.com\superuser.com) and here (apple.com).

Another way to do that is to run a Remote Control Software (for example, Team Viewer), but it's laggy and unstable.

Upvotes: 0

anonymous
anonymous

Reputation: 1490

If your work Mac has restricted firewall, and speed is your concern, you can try shadowsocks-libev to bypass the firewall, which is primarily designed to bypass GFW, and used by millions of sneaky users. It is so fast that no vpn can compete with it.

For your work device (server side)

brew install shadowsocks-libev
# ss-server and ss-local installed
# create a server with listening port 3333
# sudo may be required
ss-server -p 3333 -m chacha20 -k your_password -u

For you client (home device)

brew install shadowsocks-libev
# apt install shadowsocks-libev
# sudo may be required
ss-local -s WORK_IP -p 3333 -b 127.0.0.1 -l 1080 -k your_password -m chacha20 -u

This created socks5 proxy with 127.0.0.1:1080. Make sure "your_password", port "3333", encrypt method "chacha20" should be matched on both sides.

set your home deivce (client side) socks5 proxy as 127.0.0.1:1080. Done.

Test IP

# With proxy, this would show your work Mac's IP
curl -x socks5h://localhost:1080 ifconfig.co/json
# without proxy
curl ifconfig.co/json

As a client side, GUI version is also recommended for beginners. Open source Mobile Version is also available.

This is a demo only. For security reasons, do not contain any password in the command line. Use -c config.json instead.

Upvotes: 1

karmakaze
karmakaze

Reputation: 36134

Your problem is not what you need to do on your Mac. What you do on the Mac-side is only half of any viable solution.

What you need to find out is what ways of connecting to the "company network" are provided by the company? Is anyone able to connect to the company network from a non-Mac computer? Does the company have any IT staff? Or do you have auth/means of changing their network configuration?

Upvotes: 0

Mayur Kukadiya
Mayur Kukadiya

Reputation: 2747

You should use any-desk or VNC server for connect your machine remotely. it's easy to use.

Upvotes: 0

timur
timur

Reputation: 14567

Since you brought up OpenVPN and Tunnelblick I should probably point out that

Tunnelblick is a free, open source graphic user interface for OpenVPN on macOS

Therefore Tunnelblick is probably going to be your app of choice.

Again, since you clearly are looking at OpenVPN I should point out there are two editions in circulation at the moment: commercial and community. I don't see any reason why you should pick commercial edition as your setup seems to be pretty simple. You probably will end up with a checklist of following things to do:

  1. set up an OpenVPN server in your company network (windows, linux, pc, mac, raspberry pi - range of supported platforms is very extensive)
  2. on the server generate keys for your client(s) (or use pre-shared secret as described in quick start below)
  3. write and securely transport .ovpn config files (you can embed keys in there for simplicity) over to your mac
  4. import the .ovpnfile into your Tunnelblick and start

The official quick start guide is probably the best place to start quick.

There's a whole bunch of other things that you (or more likely, your workplace network admin) will have to sort out. Just to name a few: routing and NAT-ting, ip address/domain name for OpenVPN server, firewall rules on machines you connect to. But covering it all here without knowing your specifics will be problematic.

Upvotes: 0

Alexander Mladzhov
Alexander Mladzhov

Reputation: 595

You can try this: vpn client

You should ask your admins to set up a vpn account for you. After that you can connect with a vpn client( of your choosing your use barracuda) and the provided credentials. Hope to have helped.

Upvotes: 0

Related Questions