Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 27 May 2018, 21:50
All times are UTC - 4
 Forum index » Off-Topic Area » Security
XSecurty, SSH, XDMCP, xauth, etc.
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [17 Posts]   Goto page: Previous 1, 2
Author Message

Joined: 02 Sep 2014
Posts: 973

PostPosted: Sat 12 May 2018, 04:23    Post subject:  

So, I got something more working with ssh. Here's a draft tutorial (Will post an actual tutorial when I figure everything out). Right now, I'm doing ssh XForwarding on my local machine and displaying on a Xephry window. The distribution I'm using is tahrpup. The point of this is to experiment with ssh XForwarding on a single machine, but it could also have applications for setting up chroot environments.

Here are the steps:
1. install openSSH via the puppy package manager.
2. optionally install xauth from the puppy package manager #May not be necessary. Need to experiment more.
3. install Xephyr from the puppy package manager.
4. install twm from the puppy package manager #Not necessary but it will work better for this than jwm.
5. edit /etc/hosts.allow as follows:


the blank line at the end of the file is necessary.
Configure your ssh client and server. My configuration files are:
/etc/ssh/sshd_config #for the server
/etc/ssh/ssh_config #for the client

clink on the above links to see my configuration. My configureation files at this point are fairly permissive because I'm just trying to get things working.

6. Start Xephyr. Here is the script that I created to do so:

set -xv
exec &> /mnt/sdc6/start_Xephyr.log
export HOME=${HOME:-/root}
export DISPLAY=${DISPLAY:-':0'}
exec /usr/bin/Xephyr \
  -ac "$NESTDISPLAY" -screen 768X768 -reset -terminate  \
  -nolisten inet6 -keybd ephyr,,,xkbmodel=pc102,xkblayout=us,xkbrules=xorg,xkboption=keypad:pointerkeys,terminate:ctrl_alt_bksp

use "setxkbmap -query " to adapt the script to your keyboard. Also as noted above for better security remove the -ac option and specify the location of the Xautority file. However, it might be better to try to make things work first before tightening up the security.

7. Start the ssh server:

/etc/init.s/ssh start

8. Connect to the ssh server

ssh -Y root@

Either the -Y or -X option should work to give X11 Forwarding but in my case it isn't doing anything because I get this error:

Warning: No xauth data; using fake authentication data for X11 forwarding.
X11 forwarding request failed on channel 0

You can try doing the following before logging in with ssh

export DISPLAY=:10

but this didn't work for me. All is not lost. Make sure the display variable is set with the above export statment and then type

twm & #if you want you can use a different window manager such as jwm but twm is better here.

and hit enter twice.

It seems that in an ssh shell I have to start the window manager first but if I do it in a regular console the order doesn't seem to mater. You can now start other aps:

geany &


rox &

I'll figure out later how to start them without having to press enter twice.
Back to top
View user's profile Send private message 

Joined: 02 Sep 2014
Posts: 973

PostPosted: Wed 16 May 2018, 01:57    Post subject:  

Some notes for me. You can see which ports are being used by X11 as follows:

root# netstat -atunp
Proto Recv-Q Send-Q Local Address  Foreign Address  State   PID/Program name
tcp        0      0*        LISTEN  24423/Xephyr


I was able to solve some errors with xauth by adding
to ~/.profile the following:

    # DISPLAY is set and points to a local display, and XAUTHORITY is
    # set, so merge the contents of `$XAUTHORITY` into ~/.Xauthority.
    XAUTHORITY=~/.Xauthority xauth merge "$XAUTHORITY";;


If I start Xephyr on display :10 ssh forwarding seems to use the next available display for the forwarding. So if my sshoffset is 10, then DISPLAY=:11 would be the next available. The display variable looks like this

echo "$DISPLAY"

which is in the format (HOSTNAME:DISPLAY:SCREEN).

This isn't a valid format for the display input to Xephyr. Rather Xephyr should be called like

Xephyr :11

if we actually wanted to use display 11, which we don't. One could get the host name as follows:


and IP address as follows:

IP_Addr=$(getent -i hosts ${NESTDISPLAY%%:*} | cut -d$' ' -f1)

Note that the host command won't work because it doesn't look in your host file. Instead it does a direct DNS lookup, and even if you installed either bind or dig, the host command won't work because the libgost.so library is missing from the openssh package in tahrpup. This can be fixed by installing libssl1.0.0 from ubuntu.com but as I noted wouldn't be what we want anyway.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [17 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Security
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0495s ][ Queries: 12 (0.0182s) ][ GZIP on ]