X11 is the X Window System which allows you to run software on a UNIX/Linux server in a Windows-like way such that you can use your mouse to click around in it.
The secure way to do this is to forward your X11 packets through your ssh connection which automatically sets your DISPLAY environment variable for you. Manually setting your DISPLAY environment variable opens your computer up to security risks.
Here is the process to enable x11 forwarding in Kali Linux:-
First open the Linux terminal, By default terminal shortcut key is mapped to Ctrl+Alt+T or either Open with GUI.
First, we need to generate RSA key using ” ssh -keygen -t rsa ”
then check the “ service ssh status ” command to view the running status of SSH services, make sure it’s running.
then navigate to “nano /etc/ssh/sshd_config”
add “PermitRootLogin yes” in Authentication option.
enable X11Forwarding yes
Now you need to restart SSH services with “service ssh restart” command.
Now download Putty and navigate to X11, under Connection > SSH > Auth
now you need to use -G option with your command, like in my case I want’s to open yersinia then in this I need to use “yersinia -G” without quotes.
Now it will open Yersinia GUI on X11 Forwarding. That’s it.
Note:- I have written a post for people looking for How to set up Kali Linux VirtualBox ?, do read it If you are interested.