Author Topic: How to SSH with GUI  (Read 5100 times)

0 Members and 1 Guest are viewing this topic.

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
How to SSH with GUI
« on: September 14, 2016, 03:25:25 am »
OK, I just installed the full kali linux on the Pi Zero.

I SSH to it via Putty and actually used gparted that popped up a graphical window to resize the partition.

But how do I remote in and get the Kali GUI? so I can use it.

Also, I have two wireless adapters. and am not sure how to install / configure them. Based on this ... actually.

https://www.youtube.com/watch?annotation_id=annotation_3138311409&feature=iv&src_vid=NvX9Dmxixaw&v=aZGTxzmJeSI

I know I'll have to put the adapters on a hub, but will kali just automatically configure them? when it boots?
Gone

Offline Dan Graves

  • All Time Legend
  • *******
  • Posts: 6568
  • Good Vibes 168
  • Is on the Outside, looking in
Re: How to SSH with GUI
« Reply #1 on: September 14, 2016, 02:09:01 pm »
Kali will have all the drivers for that USB dongle (or it should, i use the same ones at home), so that part should be easy.
Kali should also natively come with RDP (Remote Desktop).
The real question is, from what are you connecting to the Pi 0 ? Phone ? Tablet ? PC ?
If you do it from the video, he literally tells you what you need to do, simply follow his instructions to a T (provided you can understand him well enough, i had some trouble understanding him here and there).
I'd also note he's not using Kali in the video, the desktop shown on his phone is Rasbian.
"You need a little bit of insanity to do great things"
--Henry Rollins

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
Re: How to SSH with GUI
« Reply #2 on: September 14, 2016, 03:17:17 pm »
Well, right now I'm using a laptop. I may try the phone later like he has.

Also, I was thinking, hoping, I can use this to grab a weak signal when I'm in my car. I was hoping the antenna will work better than just my laptop at pulling in a signal from a store or home that is broadcasting an Xfiinity signal.

But back to the gui, in SSH all I get on my laptop is a terminal window. When I try remote desktop or vnc viewer is says connection refused. Everyone else just seems to type the ip address, press go, and boom, they are in
Gone

Offline Majik

  • Stadium Superstar
  • ******
  • Posts: 1959
  • Good Vibes 110
Re: How to SSH with GUI
« Reply #3 on: September 14, 2016, 04:40:27 pm »
SSH is a terminal access protocol, so all you should normally get is a terminal window. In fact the terminal window itself is created by putty which creates a terminal session to the remote system. Putty itself has no GUI capabilities.

It is possible to do some limited GUI work via ssh, but there's a list of dependencies for that which you probably don't meet.

tl;dr: ssh is probably not the tool you are looking for.

In case you are interested, those dependencies are:
- You must be running an X11 capable system on your client, typically a desktop Linux or other Un*x OS. Windows is not natively X11 capable, nor is Android
- The remote machine must have X11 libraries/utilities installed
- The remote machine must have X11 Forwarding enabled

If these dependencies are met, then it is possible to ssh into a remote system and launch individual GUI apps on that system which will then display on your local desktop. You cannot get the remote system's full desktop GUI, only individual applications, and those need to be launched by executing them from the terminal window.


VNC Viewer is definitely what you need, and what he is using in the video.

I'm not convinced VNC server is installed as standard on Kali Linux though. I think you may need to install if yourself using these instructions.

Cheers,

Keith
Guitars: PRS Singlecut S2, Fender Tele Lite Ash, G&L Legacy Tribute, Freshman Apollo 2 OCBX
Amps: Bugera G5 Head, Boss Katana 100
All sorts of other stuff.

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
Re: How to SSH with GUI
« Reply #4 on: September 14, 2016, 04:59:54 pm »
Ok, yes, I see now everyone has been using Putty to get something going on the kali box. Then... using vnc or remote desktop to access.

I'm installing xrdp now as that is what everyone seesm to use on kali.


I can't get it to start..

It says var/run/xrdp has wrong permission

I'm doing ----- service xrdp start but it won't start.

service xrdp status shows that error above. Not sure why it have wrong permissions.. I'm logged in as root doing all this.

ETA:
update-rc.d xrdp enable   ok, I got it running and got a login screen bu t no login yet.. getting closer anyway.


ETA again:
Oh well, that didn't last long. Must have been a glitch that it opened for a second but it's back to refusing connection now.

Trying one more instruction I found

===============


    Apt-get remove gnome-core
    apt-get install lxde-core lxde kali-defaults kali-root-login desktop-base
    update-alternatives –config x-session-manager
        Choose /usr/bin/startlxde

Got the first two lines to run.. the third line unknown argument -config

https://msitpros.com/?p=3209

OK, I see --config   2 "- "


« Last Edit: September 14, 2016, 06:21:53 pm by TB-AV »
Gone

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
Re: How to SSH with GUI
« Reply #5 on: September 14, 2016, 06:28:13 pm »
Oh well,,,, none of that worked either.

Back to the drawing board. Maybe I can connect a monitor and do it through the GUI?
Gone

Offline Majik

  • Stadium Superstar
  • ******
  • Posts: 1959
  • Good Vibes 110
Re: How to SSH with GUI
« Reply #6 on: September 14, 2016, 07:11:04 pm »
The second bunch of commands is just switching from using "Gnome" as the desktop environment to using "LXDE".

I'm not sure why you would want to do that (other than LXDE might be faster for remote desktops as it's a more lightweight environment), but it certainly shouldn't make xrdp work on it's own.

Have you tried restarting the xrdp server again? Does it give any errors?

You may also be able to see the status of the xrdp service with:
service xrdp status

Note if you are rebooting at all, the xrdp service as configured will not automatically start on boot.

Cheers,

Keith
Guitars: PRS Singlecut S2, Fender Tele Lite Ash, G&L Legacy Tribute, Freshman Apollo 2 OCBX
Amps: Bugera G5 Head, Boss Katana 100
All sorts of other stuff.

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
Re: How to SSH with GUI
« Reply #7 on: September 15, 2016, 12:52:41 am »
Yeah, that link said he had a problem with connecting when using gnome so after he tried lxde it worked fine. I figured what the hell. I'll try that.

Yes, I ran the command that makes xrdp run at boot. But I also got the service xrdp start to work.

The strange thing is I once again connected with windows remote desktop but it wont actually log in. It locks up, then all subsequent attempts, are rejected.... IOw, the best I have done is get the kali login screen twice but no further.

At the time of that the laptop is SSHd into the Pi in a terminal. The Win7 desktop is doing he remote desktop access. Not sure if two people trying to be root is an issue or not.
Gone

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
Re: How to SSH with GUI
« Reply #8 on: September 15, 2016, 12:54:48 am »
[email protected]:~# service xdrp status
Unit xdrp.service could not be found.


This is really bizarre.
Gone

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
Re: How to SSH with GUI
« Reply #9 on: September 15, 2016, 12:59:13 am »
Ok, typo....

[email protected]:~# service xrdp status
● xrdp.service - xrdp (X Remote Desktop Protocol) protocol server
   Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2016-09-14 17:33:59 UTC; 6h ago
     Docs: man:xrdp(8)
           man:xrdp.ini(5)
 Main PID: 718 (xrdp)
   CGroup: /system.slice/xrdp.service
           └─718 /usr/sbin/xrdp

Sep 14 17:37:42 kali xrdp[776]: (776)(-1225518576)[WARN ] local keymap file for 0x0409 found and doesn't match built in keymap, using local keymap file
Sep 14 17:37:56 kali xrdp[776]: (776)(-1225518576)[INFO ] An established connection closed to endpoint: NULL:NULL - socket: 16
Sep 14 17:38:00 kali xrdp[776]: (776)(-1225518576)[INFO ] An established connection closed to endpoint: NULL:NULL - socket: 16
Sep 14 17:38:04 kali xrdp[776]: (776)(-1225518576)[INFO ] An established connection closed to endpoint: NULL:NULL - socket: 16
Sep 14 17:38:09 kali xrdp[776]: (776)(-1225518576)[ERROR] Failure to connect to sesman: 127.0.0.1 port: 3350
Sep 14 17:38:09 kali xrdp[776]: (776)(-1225518576)[INFO ] An established connection closed to endpoint: NULL:NULL - socket: 16
Sep 14 17:38:09 kali xrdp[776]: (776)(-1225518576)[DEBUG] return value from xrdp_mm_connect 1
Sep 14 17:38:09 kali xrdp[776]: (776)(-1225518576)[INFO ] An established connection closed to endpoint: 0.0.0.0:60829 - socket: 11
Sep 14 17:38:09 kali xrdp[776]: (776)(-1225518576)[DEBUG] xrdp_mm_module_cleanup
Sep 14 17:38:09 kali xrdp[776]: (776)(-1225518576)[ERROR] Listening socket is in wrong state we terminate listener
[email protected]:~#



ETA:
[globals]
# xrdp.ini file version number
ini_version=1

bitmap_cache=yes
bitmap_compression=yes
port=3389
allow_channels=true
max_bpp=32
fork=yes
# minimum security level allowed for client
# can be 'none', 'low', 'medium', 'high', 'fips'
crypt_level=high
# security layer can be 'tls', 'rdp' or 'negotiate'
# for client compatible layer
security_layer=rdp
# X.509 certificate and private key
# openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days$
certificate=



I changed the ini file to 3350 but it still didn't work
« Last Edit: September 15, 2016, 03:21:49 am by TB-AV »
Gone

Offline Majik

  • Stadium Superstar
  • ******
  • Posts: 1959
  • Good Vibes 110
Re: How to SSH with GUI
« Reply #10 on: September 16, 2016, 09:26:20 am »
"sesman" is a session manager service which handles the login IDs, passwords etc.
It's a separate daemon from xrdp itself, but xrdp is dependent on it and will try to connect to it when it starts. Sesman should be installed as part of the xrdp package and should be started when the xrdp service starts (it doesn't have it's own "service" command).

It seems you don't have sesman running, which is why you get the " Failure to connect to sesman: 127.0.0.1 port: 3350" error.

Changing xrdp to use port 3350 is not the right thing to do. You should change that back to port 3389.

Sesman not starting would explain why the login doesn't work, but I'm afraid I can't really help you with why that's not running. It may also be that sesman is started, but something (such as selinux) is blocking xrdp from connecting to it.

Maybe looking in the sesman logs (possibly at /var/log/xrdp-sesman.log) would give some clues.

Cheers,

Keith
« Last Edit: September 16, 2016, 11:28:30 am by Majik »
Guitars: PRS Singlecut S2, Fender Tele Lite Ash, G&L Legacy Tribute, Freshman Apollo 2 OCBX
Amps: Bugera G5 Head, Boss Katana 100
All sorts of other stuff.

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
Re: How to SSH with GUI
« Reply #11 on: September 16, 2016, 05:24:08 pm »
I'm convinced I'm cursed when it come to Linux.

So I canned the idea of Kali on the Pi Zero. It was so slow.

Grabbed a new Pi 3.

Installed the image.
Ran apt-get update && upgrade -y

ran gparted to use all 16G.

Everything is fine. Logout, restart... Boom... it looks to reboot then I'm just stuck with a mouse cursor on black screen. AND... that's the second time.... I thought maybe I did something wrong the first time as I was unplugging the monitor, so I reburned the image.. .same result......

I'm going to let it sit a couple hours and see if anything magically happens but i have my doubts.

On the Pi Zero I'm going to try OSMC/Kodi as that actually seems to be working. I just can't think of anything else to do with a zero.

Really frustrating.

Honestly the only thing I've even been able to get working on a Pi is either the very basic Raspbian or Openelec Kodi.

I don't know what the deal is with Kali... no errors, I mean I got logged in, set the router access password, ran updates, no problem. Reboot and it's all for nothing.

--- I think you were right btw, about that sesman... it seemed like to be it was not doing what it was supposed to, but I have no idea how to go about fixing that. All the video I watch, it's like bang, bang, bang, and everything works...... not for me though.
Gone

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
Re: How to SSH with GUI
« Reply #12 on: September 17, 2016, 06:39:16 am »
Well for anyone that bought the board game and are playing along at home.

I was able to to get kali-linux-top10 installed.

what I noticed was happening with full was that when it tried to boot to gui there would be 1 pixel and the mouse pointer would be touching it. that is where it would hang. I could press the key just left of the right hand Ctrl. and a little menu would pop up with cut, paste, copy, etc...  So it was like an EDIT drop menu. I found that by accident.

So the Kali forum has some reasonably similar problems.

I'm going to try kali-linux-wireless next and see if that will work.

I think it's a bug although me being a Linux idiot doesn't help.
Gone

Offline Dan Graves

  • All Time Legend
  • *******
  • Posts: 6568
  • Good Vibes 168
  • Is on the Outside, looking in
Re: How to SSH with GUI
« Reply #13 on: September 19, 2016, 08:54:04 pm »
I have a question : why Kali ?
I'd like to point out that while Kali is a security toolkit, it is NOT secure in the slightest.
It even tells you that in it's manual/FAQ.

I'm also wondering what you mean with wanting to 'grab a weak signal when in my car'.
Are you going Wardriving ? (if so, you need to ask in the Kali forums, or you need to get me on Skype)

"You need a little bit of insanity to do great things"
--Henry Rollins

Offline TB-AV

  • Honorable Ex-Mod
  • All Time Legend
  • *****
  • Posts: 14966
  • Good Vibes 329
Re: How to SSH with GUI
« Reply #14 on: September 19, 2016, 09:30:29 pm »
No special reason on Kali. It just seemed like something cool to do.

Also I'm starting to add quite a few automation devices to my home. Right now it's mostly lights and sensors, but I was doing something the other day and up pops a "new thermostat" ... well, I don;t have a new thermostat..... although some of the open/close sensors do have a temp sensor built in but I don;t think that's it.

So, as far as Kali, I just thought what the hell, it would be kinda cool to have if I could learn to use it a bit. At this point, I can't even break into my own computer much less someone elses.

So, I'm not married to it, but as I understand it you can also install Metaslpoit and learn to compromise it with Kali... or protect from Kali for that matter...

So anyway... not married to the Kali idea, just thought it might be interesting. I would like some network observation tools though... better than what I have now which is damn near nothing.

Wardriving... kinda... I thought the little dual antenna setup that guy had I might could add a stronger antenna to pull signal in. Like I said, Xfinity is everywhere and they are even doing this thing of broadcasting an open connection off a subscribers box. It gives others a connection to xfinity outside that customers network. Or, there are simply many xfiity hotspots... BUT... they are not 'hot enough' I can see them but signal is too weak. Like I can be in a parking lot. I know the signal is here. I see it on the xfinity app on my phone but it's gps is not exactly accurate... So I drive around the building looking for exactly where it is.... then maybe no parking even if I find it OR.. maybe no matter what the signal stays weak unless I go inside.

Oh... by the way... sidebar:
If I tether a laptop to my phone, can AT&T tell that I am tethering? The reason I ask is because I have an old AT&T unlimited data plan.... BUT... it also disallows tethering. Technically, now, I can do on my phone things I could not used to do, but there are a couple things I would need to tether. I wouldn't be eating up data, so usage wouldn't matter but I wondered if they would see a mac address or such connecting to the phone... I haven't been able to find an answer to that and don;t want to ask them of course.

That would be helpful to me in certain areas.

So not wardriving per se.... but simply an access point that pulls in weak Xfinity signals so I can log into my account.

Oh, I got that Pi 0 running KODI and it is surprisingly fast. It's kinda slow moving between menus but the actually playing sees ok.

So what I really want is a network observation box and a weak signal AP. If I could make the weak signal device on a Pi 0, that would be great too as it would live in my vehicle. Then the other one be something I can use anywhere and learn over time.

Extra Credit: He's another one for you.
Pi 0 - mini usb connector. I bought a cable that changes that to standard usb size. Tried 2 USB3 hubs to no avail. Used an old usb2 and it worked. All powered hubs.

I just got a couple of these little adapter things that have exposed pins and stick inside a usb plug to convert to that mini style. Have not tried them yet.



« Last Edit: September 19, 2016, 10:27:21 pm by TB-AV »
Gone

 

Get The Forum As A Mobile App