Gui in SSH connection?

So I can SSH into my Security Onion box in the house, but is there an easy way to launch the gui in the ssh session?
For Example:When I am at the terminal at work I just type startx and it launches the gui, need some help on how to do it via the ssh connection.

Remote computer: Security Onion (Ubuntu 14.04.05 LTS)
Laptop SSHing from : UbuntuMate 16.04

You need to enable x forwarding, which you can do in the ssh config file or you can run ssh -X, but you may also need to enable it on the ssh server settings too.

2 Likes

I went to etc/ssh/ssh_config and added X11Forwarding yes at the bottom.

I then typed ssh -X [email protected] but no gui came up

Did you enable x forwarding on the server too, it's in /etc/ssh/sshd_config (remember to restart the service)

Startx might not work (or they might be using a different method where you work) but you could try gnome-session (depending on what DE the server is running) you can also just launch the gui application without having to have the whole desktop.

1 Like

Both are Ubuntu. Isn't Remmina preconfigured on both ends for X sessions (that sounds so wrong lol, but nevermind)?

No idea what remmina is, i have been a very ligjht user of ubuntu as i rarely need to do all that much on my laptop as its only an xps13 and not really suited to much but web browsing.

Remmina is the default POSIX compliant remote desktop application that is preinstalled and preconfigured in many *nix distros. It supports most protocols, including SSH. If you Alt and start to type remmina, it should just pop up as a suggestion in Ubuntu.

sudo gnome-session

** (gnome-session:5897): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-YrP3FvlXWc: Connection refused

** (gnome-session-check-accelerated:5902): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-YrP3FvlXWc: Connection refused
gnome-session-is-accelerated: llvmpipe detected.
gnome-session[5897]: WARNING: Unable to find required component 'gnome-shell'
gnome-session[5897]: CRITICAL: We failed, but the fail whale is dead. Sorry....

guess your ubuntu 14 is not on gnome then lol

Changes made so far:

In /etc/ssh/ssh_conf
ForwardingAgent yes
ForwardX11 yes
ForwardX11Trusted yes

Also tried gnome-session
(see error above seems like wont work)

It doesn't bring up a Desktop, but you can launch X11-windows remotely by using X11-forwarding.
E.g. start filebrowser, chrome, etc etc. from your remote computer and the gui is shown locally.

[email protected]:~$ chromium-browser
X11 connection rejected because of wrong authentication.
[8005:8005:0301/052724:ERROR:browser_main_loop.cc(261)] Gtk: cannot open display: localhost:10.0

if i type sudo before

[0301/052919:ERROR:nss_util.cc(94)] Failed to create /home/user/.pki/nssdb directory.
[0301/052919:FATAL:chrome_main_delegate.cc(412)] Check failed: process_type.empty(). Unable to get the user data directory for process type: zygote

0 0x7f8eb3c6ca2e base::debug::StackTrace::StackTrace()

1 0x7f8eb3c86f87 logging::LogMessage::~LogMessage()

2 0x5559d85565bc

3 0x7f8eb19d7ee9

4 0x7f8eb19d65ed content::ContentMain()

5 0x5559d85558e8

6 0x7f8ea73f4f45 _libcstart_main

7 0x5559d85557ba

[8234:8234:0301/052920:FATAL:zygote_host_impl_linux.cc(182)] Check failed: ReceiveFixedMessage(fds[0], kZygoteBootMessage, sizeof(kZygoteBootMessage), &boot_pid).

0 0x7fddbdbf9a2e base::debug::StackTrace::StackTrace()

1 0x7fddbdc13f87 logging::LogMessage::~LogMessage()

2 0x7fddbbd2e1c3 content::ZygoteHostImpl::LaunchZygote()

3 0x7fddbbd2d232 content::ZygoteCommunication::Init()

4 0x7fddbbd2d7ae content::CreateZygote()

5 0x7fddbb9f9677 content::BrowserMainLoop::EarlyInitialization()

6 0x7fddbb9fc7ff

7 0x7fddbb9f5e1d content::BrowserMain()

8 0x7fddbb9643d4

9 0x7fddbb963611 content::ContentMain()

10 0x5568521178e8

11 0x7fddb1381f45 _libcstart_main

12 0x5568521177ba

You trying to forward to a windows desktop?
If so you need a X11-windows manager installed, i believe there is one called mingx or something like that.

no im on an ubuntumate 16.04
the distant end is security onion (14.04.05 lts based)

Not sure then, when you launch the windows maybe try "DISPLAY=10:0 command" else i'm not sure what to do then.

just install X, anything xfce/kde/gnome whatever... then install vnc and config with ssh auth... it'll use ssh authentication; either way. You ain't going to get x from ssh/sftp 22 protocol... and console's won't support it.
http://www.cl.cam.ac.uk/research/dtg/attarchive/vnc/sshvnc.html

Have you enabled x forwarding in the server config (not the client) it's under /etc/ssh/sshd_config not /etc/ssh/ssh_config

Hi @mutation666. I just wanted to get some clarification. If you ssh into the machine with X forwarding enabled, are you saying you can't run "gnome-session" or even more simply something like "xterm" standalone (assuming xterm or gnome-terminal is installed)? If you haven't already installed it, install xterm. Just try and start that one application and see if it displays. Gnome requires a bunch of additional things (font server, etc). Just see if xterm or xclock works. Also, don't run it with sudo, this will get blocked because of your accounts Xauthority. The remote account doing the SSH should match the account running X windows clients.

Made them on both sides, but server was first one to get the change.