Skip to content

Kali‐RPI4 X11 forwarding

reubenajohnston edited this page Apr 13, 2025 · 1 revision

Note: we are assuming that the Kali-RPI is in good state (i.e., was rebooted by the previous user!)

SSH connection with X11 forwarding

  • SSH into Kali-RPI with X11 forwarding enabled
    $ ssh -X <HOSTNAME>.netsec.isi.jhu.edu -l <USERNAME>@NETSEC.ISI.JHU.EDU
    

Regular user X11

  1. Login via SSH with X11 forwarding using the command above
  2. Check your current X11 credentials on the raspberry pi by looking at the newest entry that was created when you logged in with -X
    $ xauth list | tail -1
    
  3. Test that X11 is working with your user
    $ xeyes
    

Sudo X11

  1. Login via SSH with X11 forwarding using the command above
  2. Get your regular user's current X11 credentials by running the xauth list command above
  3. Make sure there is a /root/.Xauthority file; if it is not there, create it using $ sudo touch /root/.Xauthority
  4. Check sudo (root) X11 credentials on the raspberry pi
    $ sudo xauth list
    
  5. If the regular user's current X11 credentials are not in the sudo list, you need to add it
    • To add them, run the following command
      $ sudo xauth add $(xauth -f /netsec/home/$USER/.Xauthority list|tail -1)
      
  6. Test that X11 is working with sudo user
    $ sudo xeyes
    
Clone this wiki locally