#StackBounty: #ruby #ssh #interactive How can I perform the equivalent of Expect's "interact" in Ruby?

Bounty: 50

I want to spawn an SSH session, respond to a password prompt to login, and then interact with the remote system. This is easy to do with Expect, but I’m finding it challenging to do this in Ruby.

In Expect, I’d simply do something like:

log_user 0
spawn ssh user@host
expect "assword" { send "my_passwordr" }
interact

However, the Ruby IO#expect method won’t provide the interactivity that I’m after. I’m also reading through the Net::SSH documentation, but haven’t found an obvious way to make the session interactive after successfully logging in.

Once the connection is successfully opened, what is needed to make the TTY/PTY on the remote host interactive?


Get this bounty!!!

#StackBounty: #ssh #x11 #raspbian #pam pam_xauth isn't working with sudo: Unsupported authorisation protocol

Bounty: 50

I’m trying to set up xauth cookie forwarding between users, so that GUI programs could be run as any user via SSH. I have added the following line to /etc/pam.d/su and /etc/pam.d/sudo:

session    optional   pam_xauth.so

However, running GUI programs as root still fails:

pi@raspberrypi:~ $ echo $DISPLAY
localhost:10.0
pi@raspberrypi:~ $ xauth list
raspberrypi/unix:12  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:11  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:0  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:10  MIT-MAGIC-COOKIE-1  XXX
pi@raspberrypi:~ $ leafpad
# leafpad window opens

pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# echo $DISPLAY
localhost:10.0
root@raspberrypi:/home/pi# xauth list
xauth:  file /root/.Xauthority does not exist
root@raspberrypi:/home/pi# leafpad
PuTTY X11 proxy: Unsupported authorisation protocol
leafpad: Cannot open display:

root@raspberrypi:/home/pi# touch /root/.Xauthority
root@raspberrypi:/home/pi# xauth add $(xauth -f ~pi/.Xauthority list | tail -1)
root@raspberrypi:/home/pi# leafpad
# leafpad window opens

I don’t have any ~/.xauth/import/~/.xauth/export files for any of the users. I’m running PuTTY+Xming on the SSH client side (not that it should matter). I was expecting pam_xauth to create /root/.Xauthority for me, but that didn’t happen. Any idea why?


Get this bounty!!!

#StackBounty: #ssh #x11 #raspbian #pam pam_xauth isn't working with sudo: Unsupported authorisation protocol

Bounty: 50

I’m trying to set up xauth cookie forwarding between users, so that GUI programs could be run as any user via SSH. I have added the following line to /etc/pam.d/su and /etc/pam.d/sudo:

session    optional   pam_xauth.so

However, running GUI programs as root still fails:

pi@raspberrypi:~ $ echo $DISPLAY
localhost:10.0
pi@raspberrypi:~ $ xauth list
raspberrypi/unix:12  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:11  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:0  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:10  MIT-MAGIC-COOKIE-1  XXX
pi@raspberrypi:~ $ leafpad
# leafpad window opens

pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# echo $DISPLAY
localhost:10.0
root@raspberrypi:/home/pi# xauth list
xauth:  file /root/.Xauthority does not exist
root@raspberrypi:/home/pi# leafpad
PuTTY X11 proxy: Unsupported authorisation protocol
leafpad: Cannot open display:

root@raspberrypi:/home/pi# touch /root/.Xauthority
root@raspberrypi:/home/pi# xauth add $(xauth -f ~pi/.Xauthority list | tail -1)
root@raspberrypi:/home/pi# leafpad
# leafpad window opens

I don’t have any ~/.xauth/import/~/.xauth/export files for any of the users. I’m running PuTTY+Xming on the SSH client side (not that it should matter). I was expecting pam_xauth to create /root/.Xauthority for me, but that didn’t happen. Any idea why?


Get this bounty!!!

#StackBounty: #ssh #x11 #raspbian #pam pam_xauth isn't working with sudo: Unsupported authorisation protocol

Bounty: 50

I’m trying to set up xauth cookie forwarding between users, so that GUI programs could be run as any user via SSH. I have added the following line to /etc/pam.d/su and /etc/pam.d/sudo:

session    optional   pam_xauth.so

However, running GUI programs as root still fails:

pi@raspberrypi:~ $ echo $DISPLAY
localhost:10.0
pi@raspberrypi:~ $ xauth list
raspberrypi/unix:12  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:11  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:0  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:10  MIT-MAGIC-COOKIE-1  XXX
pi@raspberrypi:~ $ leafpad
# leafpad window opens

pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# echo $DISPLAY
localhost:10.0
root@raspberrypi:/home/pi# xauth list
xauth:  file /root/.Xauthority does not exist
root@raspberrypi:/home/pi# leafpad
PuTTY X11 proxy: Unsupported authorisation protocol
leafpad: Cannot open display:

root@raspberrypi:/home/pi# touch /root/.Xauthority
root@raspberrypi:/home/pi# xauth add $(xauth -f ~pi/.Xauthority list | tail -1)
root@raspberrypi:/home/pi# leafpad
# leafpad window opens

I don’t have any ~/.xauth/import/~/.xauth/export files for any of the users. I’m running PuTTY+Xming on the SSH client side (not that it should matter). I was expecting pam_xauth to create /root/.Xauthority for me, but that didn’t happen. Any idea why?


Get this bounty!!!

#StackBounty: #ssh #x11 #raspbian #pam pam_xauth isn't working with sudo: Unsupported authorisation protocol

Bounty: 50

I’m trying to set up xauth cookie forwarding between users, so that GUI programs could be run as any user via SSH. I have added the following line to /etc/pam.d/su and /etc/pam.d/sudo:

session    optional   pam_xauth.so

However, running GUI programs as root still fails:

pi@raspberrypi:~ $ echo $DISPLAY
localhost:10.0
pi@raspberrypi:~ $ xauth list
raspberrypi/unix:12  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:11  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:0  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:10  MIT-MAGIC-COOKIE-1  XXX
pi@raspberrypi:~ $ leafpad
# leafpad window opens

pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# echo $DISPLAY
localhost:10.0
root@raspberrypi:/home/pi# xauth list
xauth:  file /root/.Xauthority does not exist
root@raspberrypi:/home/pi# leafpad
PuTTY X11 proxy: Unsupported authorisation protocol
leafpad: Cannot open display:

root@raspberrypi:/home/pi# touch /root/.Xauthority
root@raspberrypi:/home/pi# xauth add $(xauth -f ~pi/.Xauthority list | tail -1)
root@raspberrypi:/home/pi# leafpad
# leafpad window opens

I don’t have any ~/.xauth/import/~/.xauth/export files for any of the users. I’m running PuTTY+Xming on the SSH client side (not that it should matter). I was expecting pam_xauth to create /root/.Xauthority for me, but that didn’t happen. Any idea why?


Get this bounty!!!

#StackBounty: #ssh #x11 #raspbian #pam pam_xauth isn't working with sudo: Unsupported authorisation protocol

Bounty: 50

I’m trying to set up xauth cookie forwarding between users, so that GUI programs could be run as any user via SSH. I have added the following line to /etc/pam.d/su and /etc/pam.d/sudo:

session    optional   pam_xauth.so

However, running GUI programs as root still fails:

pi@raspberrypi:~ $ echo $DISPLAY
localhost:10.0
pi@raspberrypi:~ $ xauth list
raspberrypi/unix:12  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:11  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:0  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:10  MIT-MAGIC-COOKIE-1  XXX
pi@raspberrypi:~ $ leafpad
# leafpad window opens

pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# echo $DISPLAY
localhost:10.0
root@raspberrypi:/home/pi# xauth list
xauth:  file /root/.Xauthority does not exist
root@raspberrypi:/home/pi# leafpad
PuTTY X11 proxy: Unsupported authorisation protocol
leafpad: Cannot open display:

root@raspberrypi:/home/pi# touch /root/.Xauthority
root@raspberrypi:/home/pi# xauth add $(xauth -f ~pi/.Xauthority list | tail -1)
root@raspberrypi:/home/pi# leafpad
# leafpad window opens

I don’t have any ~/.xauth/import/~/.xauth/export files for any of the users. I’m running PuTTY+Xming on the SSH client side (not that it should matter). I was expecting pam_xauth to create /root/.Xauthority for me, but that didn’t happen. Any idea why?


Get this bounty!!!

#StackBounty: #ssh #x11 #raspbian #pam pam_xauth isn't working with sudo: Unsupported authorisation protocol

Bounty: 50

I’m trying to set up xauth cookie forwarding between users, so that GUI programs could be run as any user via SSH. I have added the following line to /etc/pam.d/su and /etc/pam.d/sudo:

session    optional   pam_xauth.so

However, running GUI programs as root still fails:

pi@raspberrypi:~ $ echo $DISPLAY
localhost:10.0
pi@raspberrypi:~ $ xauth list
raspberrypi/unix:12  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:11  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:0  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:10  MIT-MAGIC-COOKIE-1  XXX
pi@raspberrypi:~ $ leafpad
# leafpad window opens

pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# echo $DISPLAY
localhost:10.0
root@raspberrypi:/home/pi# xauth list
xauth:  file /root/.Xauthority does not exist
root@raspberrypi:/home/pi# leafpad
PuTTY X11 proxy: Unsupported authorisation protocol
leafpad: Cannot open display:

root@raspberrypi:/home/pi# touch /root/.Xauthority
root@raspberrypi:/home/pi# xauth add $(xauth -f ~pi/.Xauthority list | tail -1)
root@raspberrypi:/home/pi# leafpad
# leafpad window opens

I don’t have any ~/.xauth/import/~/.xauth/export files for any of the users. I’m running PuTTY+Xming on the SSH client side (not that it should matter). I was expecting pam_xauth to create /root/.Xauthority for me, but that didn’t happen. Any idea why?


Get this bounty!!!

#StackBounty: #ssh #x11 #raspbian #pam pam_xauth isn't working with sudo: Unsupported authorisation protocol

Bounty: 50

I’m trying to set up xauth cookie forwarding between users, so that GUI programs could be run as any user via SSH. I have added the following line to /etc/pam.d/su and /etc/pam.d/sudo:

session    optional   pam_xauth.so

However, running GUI programs as root still fails:

pi@raspberrypi:~ $ echo $DISPLAY
localhost:10.0
pi@raspberrypi:~ $ xauth list
raspberrypi/unix:12  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:11  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:0  MIT-MAGIC-COOKIE-1  XXX
raspberrypi/unix:10  MIT-MAGIC-COOKIE-1  XXX
pi@raspberrypi:~ $ leafpad
# leafpad window opens

pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# echo $DISPLAY
localhost:10.0
root@raspberrypi:/home/pi# xauth list
xauth:  file /root/.Xauthority does not exist
root@raspberrypi:/home/pi# leafpad
PuTTY X11 proxy: Unsupported authorisation protocol
leafpad: Cannot open display:

root@raspberrypi:/home/pi# touch /root/.Xauthority
root@raspberrypi:/home/pi# xauth add $(xauth -f ~pi/.Xauthority list | tail -1)
root@raspberrypi:/home/pi# leafpad
# leafpad window opens

I don’t have any ~/.xauth/import/~/.xauth/export files for any of the users. I’m running PuTTY+Xming on the SSH client side (not that it should matter). I was expecting pam_xauth to create /root/.Xauthority for me, but that didn’t happen. Any idea why?


Get this bounty!!!

#StackBounty: #ssh #ubuntu-server #webmin Unable to use webmin outside my LAN: UBUNTU SERVER on VMWARE

Bounty: 50

I have a windows PC

I have installed Ubuntu server on my Vmware and switched to Bridge Network

Now I installed webmin

sudo service webmin start

with ssl=1

also done this

sudo iptables -A INPUT -p tcp -d 0/0 -s 0/0 –dport 10000 -j ACCEPT

I can access webmin from my computer and on my LAN

enter image description here

also via browser on any device on my wifi https://192.168.187.129:10000/

enter image description here

But I cannot access this from outside network

enter image description here

enter image description here

But i cannot use this outside of my lan.

I can connect with ssh on my lan only

also done sudo ufw allow 10000

No answer on this

https://superuser.com/questions/1122496/cant-acces-webmin-outside-the-virtual-machine-running-it-virtualbox-ubuntu-s


Get this bounty!!!