Go easy on me this is my first blog.
Currently, I'm running Kubuntu 8.10 Intrepid. I've always had the setup of being able to ssh into my computer from either home or anywhere on the internet. The problem with ssh is that running any type of program like Firefox is very slow so I decided I wanted to try something more efficient. My current ssh setup has key authentication enabled with a password and it's on a port besides 21. I use a Windows PC for work so I was using Putty. I like this since it prevents brute force attacks and it's more secure. I didn't want to depart from this so I decided I'd use FreeNX.
I enabled the repo to install FreeNX and it installed without issue. I then went to set it up and this is where I had problems. To start out, I setup FreeNX to work without key authentication and this worked well when I went to turn key auth on I could never get it to work. I removed all of FreeNX and then just downloaded the nxclient, nxnode, and nxserver from Nomachine.com and just installed these. I won't go into installing these as it's very straight forward. The only thing is you need to install nxclient and nxnode before server or you'll get a dependency issue. The only issue I ran into was nxserver complaining that there was already a nx user so I had to issue the command
$sudo userdel -r nx
and then I had to reinstall nxserver.
The next thing you want to do is edit the NX config files to change the ssh port and to allow key auth. So say, you want your ssh port to be 1800. You'll want to open up /usr/NX/etc/node.cfg with nano and look for this line:
SSHDPort = "21"
and change to
SSHDPort = "1800"
If there's a # in front of SSHDPort you'll want to remove this.
Save the file and close next you'll want to edit /usr/NX/etc/server.cfg
Change these lines to the port you want ssh running on
SSHDAuthPort = "1800"
SSHDPort = "1800"
If there's a # in front of any of these two lines you'll want to remove them.
Then change the lines to the following
EnableUserDB = "1"
EnablePasswordDB = "1"
If there's a # in front of any of these two lines you'll want to remove them.
Save server.cfg and then close.
Make sure you have the proper settings in your /etc/ssh/sshd_config file
Port 1800
PubkeyAuthentication yes
PasswordAuthentication no
AllowUsers nx username
Save sshd_config and then restart ssh with $sudo service ssh restart.
Next you'll want to setup the nxserver
$sudo /usr/NX/scripts/setup/nxserver --install
If you get any errors with ssh and NX working together you'll see them here.
Next you'll want to create keys so
$sudo /usr/NX/bin/nxserver --keygen
You'll end up with a key in /usr/NX/share/keys/ .
Now, you'll want to install just the nxclient on your Windows machine by downloading the windows version from nomachine.com.
You'll then want to go to the new key at /usr/NX/share/keys/default.id_dsa.key and open this up with an editor and within the Windows client configurator click "key" and paste the key from your clipboard into here and then save. I just ssh'd in from the windows PC and navigated to the key and copied from the clipboard.
Now that you have that done, you'll now want to add a user to the NX database by doing
$sudo /usr/NX/bin/nxserver --useradd username
This will setup your keys and once this is done it'll ask you for a password. If you didn't make the edits to the server.cfg
EnableUserDB = "1"
EnablePasswordDB = "1"
it won't ask for a password and if you have your ssh setup for key auth with password you'll have problems so you'll need to remove the user by using --userdel then make the changes to the server.cfg and then readd the user.
The last thing you need to do is move the key info from the /home/username/.ssh/authorized_keys2 and append the key info to the /home/username/.ssh/authorized_keys file.
Now to make fluxbox work, you'll want to create a file and called /usr/NX/bin/nxwrapper and then add
#!/bin/bash
# Script origianlly found here:
# http://iain.cx/nx/nxwrapper.html
nxnode=$(ps -o ppid= -p $PPID)
nxagent=$(pgrep -P $nxnode -u $USER -x nxagent)
${1+"$@"}
exec kill $nxagent
then chmod the file to 755.
Then go to the nxclient on windows and click on config under the general tab make sure you have your host and port number correct then under Desktop select Unix and then custom. Then select settings then change to "Run the following command" and enter in the box /usr/NX/bin/nxwrapper /usr/bin/startfluxbox then select "New virtual desktop" then OK and then Save then Ok again. Now enter your password and enter login. You should see you fluxbox desktop.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment