$ ping myusername ping: cannot resolve myusername: Unknown host The New Workaround. After trying everything I could, I found that this command makes both VPN network and internet available to me: sudo route add -net 192.168.7.218 192.168.7.117 255.255.0.0 Company's DNS servers are accessible by their IPs. 2 days ago sudo ssh root@server2 -w 0:0 Tunnel device open failed. Could not request tunnel forwarding. Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-42-generic x8664) with -vvv debug1: systunopen: /dev/tun0 open failed: No such file or directory Tunnel device open failed. Could not request tunnel forwarding.
- Mac Os X Cannot Create Ssh Tunnel With Apple Tv
- Mac Os X Cannot Create Ssh Tunnel With Apple
- Mac Os X Cannot Create Ssh Tunnel With Appropriate
- Mac Os X Cannot Create Ssh Tunnel With Applications
Basically, a Mac application has a
.app
extension, but it’s not really a file — it’s a package. You can view the application’s contents by navigating to it in the Finder, right-clicking it and then choosing “Show Package Contents”.The internal folder structure may vary between apps, but you can be sure that every Mac app will have a
Contents
folder with a MacOS
subfolder in it. Inside the MacOS
directory, there’s an extension-less file with the exact same name as the app itself. This file can be anything really, but in its simplest form it’s a shell script. As it turns out, this folder/file structure is all it takes to create a functional app!Enter appify
After this discovery, Thomas Aylott came up with a clever “appify” script that allows you to easily create Mac apps from shell scripts. The code looks like this:
Installing and using appify is pretty straightforward if you’re used to working with UNIX. (I’m not, so I had to figure this out.) Here’s how to install it:
- Save the script to a directory in your
PATH
and name itappify
(no extension). I chose to put it in/usr/local/bin
, which requires root privileges. - Fire up Terminal.app and enter
sudo chmod +x /usr/local/bin/appify
to make appify executable without root privileges.
After that, you can create apps based on any shell script simply by launching Terminal.app and entering something like this:
Obviously, this would create a stand-alone application named
Your App Name.app
that executes the your-shell-script.sh
script.After that, you can very easily add a custom icon to the app if you want to.
Adding a custom app icon
- Create an
.icns
file or a 512×512 PNG image with the icon you want, and copy it to the clipboard (⌘ + C). (Alternatively, copy it from an existing app as described in steps 2 and 3.) - Right-click the
.app
file of which you want to change the icon and select “Get Info” (or select the file and press ⌘ + I). - Select the app icon in the top left corner by clicking it once. It will get a subtle blue outline if you did it right.
- Now hit ⌘ + V (paste) to overwrite the default icon with the new one.
Note that this will work for any file or folder, not just
.app
files.Examples
Chrome/Chromium bootstrappers
I like to run Chrome/Chromium with some command-line switches or flags enabled. On Windows, you can create a shortcut and set the parameters you want in its properties; on a Mac, you’ll need to launch it from the command line every time. Well, not anymore :)
The
&
at the end is not a typo; it is there to make sure Chromium is launched in a separate thread. Without the &
, Chromium would exit as soon as you quit Terminal.app.Launch a local web server from a directory
Say you’re working on a project and you want to debug it from a web server. The following shell script will use Python to launch a local web server from a specific directory and open the index page in your default browser of choice. After appifying it, you won’t even need to open the terminal for it anymore.
More?
Mac Os X Cannot Create Ssh Tunnel With Apple Tv
Needless to say, the possibilities are endless. Just to give another example, you could very easily create an app that minifies all JavaScript and CSS files in a specific folder. Got any nice ideas? Let me know by leaving a comment!
VPNs are powerful tools and can help keep your network traffic secure. If you have a VPS or dedicated server, you could even run a VPN service from your server. The issue is that setting up and configuring a VPN can be time consuming and complicated. For some uses, there may be an easier way to securely route your traffic through a remote server (like your VPS or dedicated server).
An SSH tunnel is another method of rerouting some or all traffic from one location (like your local computer) through another (your remote server). All of this rerouted traffic is securely encrypted as it travels between your local machine and the remote server thanks to SSH. With a tunnel active and traffic proxied through the tunnel, that traffic will appear to be coming from your remote server instead of your local machine. This can be useful to bypass remote network issues or restrictive firewalls.
This article will explain how you can set up an SSH tunnel from your local MacOS (née OS X) machine.
If you are looking for an article explaining how to set up an SSH tunnel on your Windows machine, see our article here.
Requirements
The Mac already ships with all of the tools needed to set up an SSH tunnel, but you'll also need a remote server to SSH your connection through. Here’s the full list of requirements:
- A remote server running SSH and the ability to make other outbound connections to the internet.
- A user account on the remote server that is able to log in via SSH.
- Access to the Terminal application in /Applications/Utilities/Terminal(.app) on your Mac.
- Access to the Network section in System Preferences so you can set up the system-wide proxy.
- Alternately, access to Firefox or another browser that can accept locally configured proxy connections.
![Ssh Ssh](https://static.macupdate.com/screenshots/155028/m/ssh-tunnel-screenshot.png?v=1568250640)
Mac Os X Cannot Create Ssh Tunnel With Apple
Setting up an SSH Tunnel
To set up the tunnel, you need to execute a command in the Mac's Terminal application.
- Open the Applications folder on your Mac (if you don't know where this is. open your hard drive and the folder will be found there.
- Scroll down to the Utilities folder and open that as well.
- Locate the Terminal or Terminal.app file in the Utilities folder and double click on the icon for the terminal.
- This will open a new window where you will be able to type some text.
- Type the following into the terminal window:Replace USER above with the username of the user on the remote server you are logging in as, this could be 'root' but it is generally safer to use an unprivileged user instead.
Replace server.domain.com with the hostname or IP address of your remote server.
Replace 22 at the end of the line above with whatever port your remote server accepts SSH connections on (22 is the default).If you want to understand what this command is doing, read on, otherwise skip to step 6.-f: This forks the process into the background so you don't have to keep the terminal window open to maintain the SSH tunnel.
-N: This tells the SSH process to not execute any commands on the remote server (we are only forwarding traffic through the remote server).
-M: Put the SSH client into master mode. We're doing this so we can easily enter a command later to gracefully end the SSH tunnel without having to kill the connection.
-S: This is used in conjunction with the -M command. This sets up a special kind of file (called a socket) that will allow us to enter a command later to gracefully end the SSH tunnel without having to kill the connection. /tmp/sshtunnel is the full path to the socket file this command is creating.
-D: This sets up a dynamic application level forwarding service and 1080 is the port it will listen on. This command creates the SOCKS proxy we'll use later.
-p: Specify the port on which the remote server is listening for SSH connections. - You will be asked to log into your remote SSH server.If you have to enter a password, the terminal will not show you bullets for your key strokes. You won't see anything at all. Just type your password and hit Return on your keyboard.
- Once you are connected to your remote server, you can quit the Terminal application.
Configure the Proxy Service
Now you need to set up the SOCKS proxy so that your Mac routes traffic through your remote server instead.
Until you complete this step, your traffic is not secure.
The best way to use the SSH tunnel is to configure MacOS to send most/all traffic through it. Follow these steps to configure your system. While the screenshots may look different, these directions should work on any version of MacOS back to at least Snow Leopard 10.6 (which is as far back as we can test).
- Under the Apple () menu, select System Preferences...
- Select Network.
- Look for the network connection providing your internet/networking access. This is probably Ethernet or Wifi. Click on that connection in the sidebar.
- In the main part of the Network window, look for an Advanced... button towards the bottom right and click it.
- In the new window that appears, select the Proxies tab near the top.
- Check the box next to SOCKS Proxy.
- In the first text field under the SOCKS Proxy Server, enter 127.0.0.1.
- In the smaller field next to that (after the colon), enter the port number, which was 1080 If you used the directions above.
- Click the OK button at the bottom right of this window.
- Click the Apply button to apply your network changes.
- You can close the System Preferences window now if you want.
- Test to make sure your new connection is working by opening Safari or any browser that is configured to use your Mac's network proxy settings. Go to https://hostdime.com/ip to see if your IP address has changed. It should now show the IP address of your remote server.
Mac Os X Cannot Create Ssh Tunnel With Appropriate
You are now done until you want to turn off the SSH tunnel (skip to the final section below).
If you cannot make changes to your Mac's network settings, you can still use Firefox to secure your web browsing traffic. With this method, only traffic in Firefox is routed through the proxy service, all other traffic is routed normally.
- From the hamburger menu (the menu item that looks like 3 parallel lines), select Preferences.
- You will be in the General section of the options, scroll down to the bottom and click on the Settings... button in the Network Settings section.
- Now you need to fill in the proxy details based on the proxy you set up earlier.
- Select the radio button next to Manual proxy configuration
- In the SOCKS Host section, enter 127.0.0.1.
- Enter 1080 as the Port (or whatever local port you selected when you set up the SOCKS proxy earlier),
- Click the radio button to select SOCKS v5.
- There are a few more options to consider before finalizing setup.
- Neither of the SSH tunnel options we set up require a password or authentication to use, so the first option, Do not prompt for authentication if password is saved is not going to affect anything.
- The important item is Proxy DNS when using SOCKS v5. You should check the box next to this option, otherwise your DNS requests will be made locally and someone will be able to see what sites you visited even if they can't see what you did when you went there.
- Enable DNS over HTTPS This will provide an additional layer of security at the risk of slowing down access to websites even more (at least on the first access).
- Click the OK button to apply these changes.
Test the proxy by revisiting https://hostdime.com/ip and make sure your reported IP address has changed. If you don't see a change in the IP address, try forcing the page to refresh or quit and restart your browser and try again.
Disabling the SSH Tunnel and Proxy Service
Mac Os X Cannot Create Ssh Tunnel With Applications
To disconnect from the SSH tunnel, follow these steps:
- Disable SOCKS proxy use either by unchecking the SOCKS Proxy from the Advanced... section of the Network preference pane or by switching to System Proxy or No Proxy in the Preferences of Firefox, depending on which set of directions you followed.
- Disconnect the SSH tunnel and close the connection to your remote server.
- Launch the Terminal application from your Utilities folder in the Applications folder.
- In the terminal window, enter the following command (editing it as needed):Replace server.domain.com with the IP address or server hostname of your remote server.
Replace 22 with the port number that your remote server accepts SSH connections on. 22 is the default.If you have problems for any reason disconnecting from your remote server this way, you can always restart your Mac and that will automatically kill the connection. - Quit the the Terminal application.
- Test your connection to https://hostdime.com/ip and make sure the IP that gets reported is no longer the IP address of your remote server.