lwc:shellhub

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lwc:shellhub [2023/08/10 15:08] John Harrisonlwc:shellhub [2024/01/01 14:07] (current) John Harrison
Line 77: Line 77:
   * local machine generate public/private key.   * local machine generate public/private key.
     *  it could be that any public/private key would work but docs suggest''ssh-keygen -t ed25519''     *  it could be that any public/private key would work but docs suggest''ssh-keygen -t ed25519''
-  * upload public key to web portal (public keys menu on LHS) +  * upload public key to web portal (public keys menu on LHS) 
 +  * make sure private key on local machine has permissions 600
   * login from local machine using private key: ''ssh -p <PORT> -i <PRIVATE_KEY_PATH_AND_FILE> <USER>@<SSHID_FOR_REMOTE>@<HOST_IP_OR_NAME>''   * login from local machine using private key: ''ssh -p <PORT> -i <PRIVATE_KEY_PATH_AND_FILE> <USER>@<SSHID_FOR_REMOTE>@<HOST_IP_OR_NAME>''
  
 === Disable Password login === === Disable Password login ===
 //This is not a built-in function for community edition it appears so as a workaround we can hack the code// //This is not a built-in function for community edition it appears so as a workaround we can hack the code//
-  * in ''/pkg/agent/server/server.go'' edit ''func (s *Server) passwordHandler('' so the first line of the method reads ''return false''+  * pre v0.13.0: in ''/pkg/agent/server/server.go'' edit ''func (s *Server) passwordHandler('' so the first line of the method reads ''return false'' 
 +  * post v0.13.0: in ''/pkg/agent/server/authentication.go'' edit ''func (s *Server) passwordHandler(ctx gliderssh.Context, pass string) bool {'' so the first line of the method reads ''return false''
   * ''cd shellhub/agent''   * ''cd shellhub/agent''
   * ''go build -ldflags "-X main.AgentVersion=<VERSION>"''   * ''go build -ldflags "-X main.AgentVersion=<VERSION>"''
 +
 +==== Setting up VNC on remote (Xubuntu 22.04) ====
 +=== On Remote ===
 +  * ''sudo apt install xtightvncviewer''
 +  * change ''~/.vnc/xstartup'' to read:
 +<code>
 +env -i /bin/sh -c "export PATH=$PATH;
 +                   export XAUTHORITY=$XAUTHORITY;
 +                   export DISPLAY=$DISPLAY;
 +                   export HOME=$HOME;
 +                   export LOGNAME=$LOGNAME;
 +                   export USER=$USER;
 +                   /usr/bin/xfce4-session"
 +</code>
 +  * write a script:
 +<code>
 +#!/bin/bash
 +if ! pgrep -x "Xtightvnc" >/dev/null
 +then
 +    vncserver -geometry 1366x768
 +fi
 +</code>
 +  * call this script in session and startup (yes systemd is the right way to do this but I couldn't get it to work)
 +  * restart Xserver
 +=== local ===
 +  * ''ssh -p 24 -i <PRIVATE_KEY> <NAME_OF_REMOTE> -L 5901:127.0.0.1:5901''
 +  * then in a separate window ''gvncviewer :1''
 +
  
  • lwc/shellhub.1691698100.txt.gz
  • Last modified: 2023/08/10 15:08
  • by John Harrison