![]() LOGFILE="/root/Tunnel/logBatchRestart.log" I read in some other thread in stackoverflow that one should use autossh that will ensure the ssh will always be ok through a recurrent check. In order to do that, I wrote the following batch that I then added into crontab (the batch is automatically processed every 5 minutes during workdays and from 8am to 9pm). This will make sure that the next time logged in will include all the settings here.I am a beginner user of linux, and also quite newbie at ssh and tunnels.Īnyway, my goal is to maintain a ssh tunnel open in background. Once all the settings desired are configured, select Session, highlight the session again in Saved Sessions and hit Save for the new session settings.This will ensure that the tunnel uses data compression. After setting up the tunnel, select SSH and enable compression.Once your session is setup, select your session that was just saved from the last cookbook, then on the left-hand panel, select Connection -> SSH -> Tunnels.Once PuTTY is downloaded, configure the SSH connection before adding the tunnel.įor more information see Connecting with PuTTy.There are many ways to set up an SSH tunnel, however, this cookbook will utilize PuTTy.This should incur an instance of your tunnel. For example, "FreyaTunnel" in this example would be the alias typed into any terminal. bashrc file and the ssh key is added to the remote device, open any terminal and simply type in the alias name. This can be done by typing in ssh-copy-id (see below example). Finally, add your public key that you generated earlier via SSH. Add your SSH key to the device being forwarded.The private key and public key of the key pair must be saved to the local computer while only the public key of the pair must be saved to the remote server. This means that one needs to be generated. Next, this ssh connection will require an ssh key.In order for our machine to remember certain passwords and access configurations, some additional edits in the ~/.ssh/config file or $HOME/.ssh/config.This will enable the code without the need to turn off and restart the device. bashrc file, source the file in order for the changes to be applied. 5903 - local port for VNC to connect to.4132 - local port for GUI to connect to.4131 - local port for perl scripts to connect to.4002 - GUI uses this for binary connection to LANforge server.4001 - perl scripts use this for ascii connection to LANforge server.In the example included above we've included the following ports for the according reasons: The generic setup of bash aliases for SSH are ssh -flags localport:ipaddress:remoteport.Please visit the SSH man page for further flags and switches:.Use this flag multiple times to forward multiple ports with one command. ![]() -L = bind_address:port:host:hostport format.Causes SSH to print debugging messages about its progress. N = do not execute a remote command, useful for forwarding ports.Required when SSH is running in the background. ![]() This is desirable for slower connections. Flags used in the bash alias creation example below are as followed: bashrc file is open, type in your alias in any blank spot (that is not within another for-loop or definition). bashrc file is where the alias will be setup to properly invoke your ssh. bashrc file can be opened via gedit, vim, or nano.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |