<br><tt><font size=2>Adrian Coman <adi.coman@gmail.com> wrote on
16/04/2011 20:10:03:<br>
<br>
> Hi,<br>
> <br>
> I would like to setup a NX server that users can connect to, but <br>
> they can not copy files from the server via SCP. Since NX functions
<br>
> through SSH, I have to leave the SSHD port open, so all the SSH <br>
> functionality is there, including SCP.<br>
> <br>
> Do you have any suggestion?</font></tt>
<br>
<br><tt><font size=2>You can run two sshd daemons.</font></tt>
<br><tt><font size=2>1/ listening on</font></tt>
<br><tt><font size=2> Port 22 </font></tt>
<br><tt><font size=2> ListenAddress
127.0.0.1 (only)</font></tt>
<br><tt><font size=2> PasswordAuthentication
yes</font></tt>
<br><tt><font size=2>2/ listening on another port</font></tt>
<br><tt><font size=2> Port 600 (choose
your own)</font></tt>
<br><tt><font size=2> ListenAddress
your.external.interface.ip</font></tt>
<br><tt><font size=2> PasswordAuthentication
no</font></tt>
<br><tt><font size=2> AllowUsers nx
admin</font></tt>
<br>
<br><tt><font size=2>** change the Port in ALL your nxclients</font></tt>
<br><tt><font size=2><Configure (button)><General Tab><Server>
**</font></tt>
<br>
<br><tt><font size=2>This arrangement is safer anyway, especialy if you
have NX</font></tt>
<br><tt><font size=2>on an Internet IP.</font></tt>
<br>
<br><tt><font size=2>If you don't then you could have 22 as the external
P/Pkey </font></tt>
<br><tt><font size=2>only, and run PasswordAuthentication on 127.0.0.1:600,</font></tt>
<br><tt><font size=2>in which case you don't need to change the nxclient
but</font></tt>
<br><tt><font size=2>you do need to update to 600 (or whatever)</font></tt>
<br><tt><font size=2> SSHD_PORT=</font></tt>
<br><tt><font size=2>in /etc/nxserver/node.conf</font></tt>
<br>
<br>
<br><tt><font size=2>Note</font></tt>
<br><tt><font size=2>This won't stop logged in NX users nc-ing or ssh-ing
back</font></tt>
<br><tt><font size=2>to their home machines unless you packet-inspect egress,</font></tt>
<br><tt><font size=2>remove the ssh client and nc from the server and don't</font></tt>
<br><tt><font size=2>allow exec from any mount that users can write to</font></tt>
<br><tt><font size=2>( a good idea anyway imho)</font></tt>
<br>
<br>
<br><tt><font size=2>It's stil possible for users to copy the nx user key
from</font></tt>
<br><tt><font size=2>the nxclient and manually connect as user nx</font></tt>
<br><tt><font size=2>eg.</font></tt>
<br><tt><font size=2>ssh -i copy-of-nx-key -l nx -p ext.sshd.port yourhost</font></tt>
<br>
<br><tt><font size=2>but the nx user's shell is set to /usr/bin/nxserver.</font></tt>
<br><tt><font size=2>> <br>
> Thanks.________________________________________________________________<br>
</font></tt>