![]() There you can create a custom profile which will open a remote shell on start: Terminator terminal emulator ![]() I use Terminator as my favorite terminal emulator. You can add a line to the script to open the remote shell automatically, for instance. There are many more possibilities for automation. Your favorite IDE or text editor will work with the mounted folder just fine. The folder should mount automatically after you connect and, in return, unmount on disconnection. Let’s create a script to automatically mount our work folder. Set a checkmark and the script will be executed locally every time the TCP tunnels are established. On the very bottom of the dialog, you will see the checkbox: Run a custom script. As before, open the TCP tunnel setting from the context menu. AnyDesk allows you to automate this process. Up until now, we had to execute commands by hand to access remote data. After you close the AnyDesk connection, the folder will be instantly unmounted. ![]() Don’t forget that you need an active AnyDesk connection for the TCP tunnel to work. If everything has been set up correctly, you will now have your remote files mounted locally. Now let’s mount it locally: sshfs -p 2222 /home/johndoe/work In this example let’s assume your work folder is: /home/johndoe/work I recommend both folders having the exact same path. Now create a folder locally where you want your remote folder to be mounted. If you haven’t got SSHFS installed, on DEB-based distributions it can simply be done via apt: sudo apt install sshfs The trick here is to mount the remote folder locally using SSHFS. Ready to Access the Remote FolderĪfter the initial setup is done, let’s set up the work environment. Now copy the keys to the remote machine: ssh-copy-id -p 2222 this step you should be able to connect to SSH without a password. Generate your SSH keys if you haven’t done so already with the following command: ssh-keygen The next step will be to copy your local SSH keys to the office PC, so the office machine will allow you access without a password. After you check the access, you may close the remote shell, as it is no longer needed. If you’ve done everything correctly, you will be asked for your password on the remote machine. Run the following in your terminal: ssh -p 2222 with the username on your office PC. Now, after you have created the tunneling rule and connected to the remote side, it’s time to test the SSH connection. I use the file transfer mode to save traffic and CPU time. The type of connection doesn’t matter, the tunnel will work in both normal and file transfer modes. This tunnel will be activated as soon as you connect to the corresponding AnyDesk ID. The exact port number doesn’t matter, we use 2222 as an example in this case. In the example above, we are forwarding the TCP port 22 of the remote machine (the remote port used by SSH) to the local port 2222. To forward the SSH port we need to add a rule into the setup window: TCP tunneling setup For our purpose, we select the direct tunnels. In the dialog box, you’ll see the settings for direct and reverse tunnels. To do so, open the TCP tunneling settings from the context menu of the address tile: Context menu in Recent Sessions Using the TCP Tunneling Feature of AnyDesk you can set up a tunnel to the remote computer and use SSH almost as if the two computers were in the same network. ![]() With AnyDesk, however, one can connect to any computer regardless of any firewalls or NATs. Usually this is not the case when you are connecting to your office PC from home. This happens, for example, if the host is on the same local network or has an external IP address. ![]() SSH, like any other TCP connection, is only possible when the host you are connecting to is visible from your local computer. Setting Up a Direct Tunnel Connection With SSH This solution is much more CPU and traffic-efficient than the classical Remote Desktop Access. In this article I will show you how to mount a remote folder locally using TCP Tunneling with AnyDesk for Linux but it’s also available for Windows and macOS devices. With AnyDesk you can set up a TCP tunnel connection which allows you to access files on a remote device locally without having to download them on your local machine. Being able to access a source code locally can often make things faster and more comfortable. Mount Remote Folders Locally With an AnyDesk TCP Tunnelįor a software developer, Remote Work can be a challenge. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |