SSH
ssh -i
# a key specified with -i will only apply to
# will not apply to or or etc!
# if you need this functionality, use an ssh config file
ssh -W @ @
# ssh to an intermediate target before sshing to the main target
# possibly combinable with -L?
ssh -L :: @
ssh @
# create tunnel with listener on localhost
# packets go through tunnel, to , and from there to :
# : does not get resolved until you get to
# there is always an implicit in front of ; this means that
# can use with VNC like so:
ssh -L :: @
ssh @
vncserver
# configure tunnel and VNC server
# note session number of new VNC server!
# and must equal session number of new VNC server + 5900
# do not close the terminal window! will break the tunnel and yr VNC connection
run TigerVNC
127.0.0.1:<59xx>
# then, from local machine again, connect to the VNC server
# some VNC viewers require the port number, some require the session number
# if one does not work for you, try the other
ssh-keygen
# keys go in the ~/.ssh dir, which must have perms of 700
# default keypair names: id_rsa, id_rsa.pub
# if different names, use -i to tell ssh which keys to use
# -t rsa -b 4096 -- also good
vi ~/.ssh/config
chmod 644 ~/.ssh/config
man ssh_config
# use an ssh config file to do cool stuff!
# anything that uses ssh "under the hood" will look at this config file
# this includes: ssh, scp, git, and more
# set defaults to apply regardless of :
# set defaults on a per-target basis:
Host
# set nickname/alias for target (to reach it by running `ssh nickname` or `ssh alias`):
Host ,
HostName
# set username to use when connecting to target:
Host
User
# set a default key to use for a particular target:
Host
IdentityFile
# ssh to an intermediate target before sshing to the main target:
!! is the order ok here, or does the IdentityFile need to be specified before the ProxyJump?
Host
ProxyJump @
Host
IdentityFile
# may be necessary, because -i only applies to not
# equivalent of the -L stuff above; refer to those notes
Host ,
LocalForward 127.0.0.1: :
ProxyJump
HostName
!! is the HostName correct? should it be or ?
# keep your session alive longer (unless session length limited by the server):
Host
ServerAliveInternal 60
ServerAliveCountMax 15
passwordless SSH!
# may combine with putting the target's IP in /etc/hosts for fast and easy SSHing
VNC
vnc section goes here
because there is already stuff about it on this page with ssh
change name: remoting? not ssh
vncserver -list
# check if there is a vncserver session running on the remote machine to connect to
vncserver [:]
# start a vncserver session
# how to config passowrd protect????
# VNC passwords are insecure!
# only considers the first 8 characters(?)
# etc etc
vi ~/.vnc/xstartup
# different configs required for different desktop environments
# if misconfigured, will cause VNC window to be gray with some checkboxes; won't show remote machine
# if anaconda is in path, will cause issues
# echo $PATH to check
chmod +x ~/.vnc/xstartup
# it must be executable
# MATE config
# XFCE config
# KDE config
????
-R ::
# create tunnel with listener on remotehost; packets go through tunnel, to , and from there to :