个人工具

“UbuntuHelp:FreeNX”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第4行: 第4行:
 
[http://freenx.berlios.de FreeNX] is a system that allows you to access your desktop from another machine over the internet. You can use this to login graphically to your desktop from a remote location. One example of its use would be to have a FreeNX server set up on your home computer, and graphically logging in to the home computer from your work computer, using a FreeNX client.
 
[http://freenx.berlios.de FreeNX] is a system that allows you to access your desktop from another machine over the internet. You can use this to login graphically to your desktop from a remote location. One example of its use would be to have a FreeNX server set up on your home computer, and graphically logging in to the home computer from your work computer, using a FreeNX client.
 
It's Open Source, secure (SSH based), fast and versatile!
 
It's Open Source, secure (SSH based), fast and versatile!
'''Note:''' At present FreeNX is limited to desktops where both local and remote machines are running Linux/Unix. Running FreeNX as server on Ubuntu with the free "NX Client for Windows" from [http://www.nomachine.com/select-package-client.php NoMachine] on a Windows workstation is working fine.
+
'''Note:''' Running FreeNX as server on Ubuntu with the free "NX Client for Windows" from [http://www.nomachine.com/select-package-client.php NoMachine] on a Windows workstation is working fine.
 
=== Terminology ===
 
=== Terminology ===
 
The ''Server'' is the computer you want to connect to. This is the computer where the FreeNX server will need to be installed. The name of the Ubuntu package providing the server is "freenx". For the example used here, the home computer is the server.
 
The ''Server'' is the computer you want to connect to. This is the computer where the FreeNX server will need to be installed. The name of the Ubuntu package providing the server is "freenx". For the example used here, the home computer is the server.
第10行: 第10行:
 
== Installation ==
 
== Installation ==
 
=== Installing the FreeNX server ===
 
=== Installing the FreeNX server ===
We will be installing the FreeNX server on the ''Server'' machine, i.e., the machine that you want to access remotely. In the stated example, this is your computer that is at home. Open your aptitude sources list and append the two lines for the repository.  
+
We will be installing the FreeNX server on the ''Server'' machine, i.e., the machine that you want to access remotely. In the stated example, this is your computer that is at home.  
<pre><nowiki>
+
FreeNX is not included in Ubuntu, so we'll add it from the [https://launchpad.net/~freenx-team/+archive/ FreeNX Team PPA].
 +
Add this repository using the [[UbuntuHelp:Repositories/Ubuntu#Third-Party Software Tab|Third-Party Sources Tab]] in Software Sources.  When it asks, Reload the information about available software.  Now you can see and install the `freenx` package in [[UbuntuHelp:SynapticHowto|Synaptic Package Manager]].
 +
Alternatively, you can edit the configuration files and install by hand: 
 +
<ol><li>Open your apt sources list <pre><nowiki>
 
gksudo gedit /etc/apt/sources.list
 
gksudo gedit /etc/apt/sources.list
</nowiki></pre>
+
</nowiki></pre> and append the two lines for the repository <pre><nowiki>  
For Ubuntu 5.10 and 6.06, they are:
+
deb http://ppa.launchpad.net/freenx-team/ubuntu VERSION main
<pre><nowiki>  
+
deb-src http://ppa.launchpad.net/freenx-team/ubuntu VERSION main
deb http://mirror.ubuntulinux.nl/ dapper-seveas freenx
+
</nowiki></pre> where VERSION can be: dapper, hardy or intrepid. More information can be found at [https://launchpad.net/~freenx-team/+archive/ FreeNX Team PPA].
deb-src hhttp://mirror.ubuntulinux.nl/ dapper-seveas freenx
+
</li><li>Save and then close.
</nowiki></pre>
+
</li><li>Then Update Apt <code><nowiki>sudo apt-get update</nowiki></code>
For Ubuntu 7.04, they are:
+
</li><li>After you add the repository, then install the <code><nowiki>freenx</nowiki></code> package (using Aptitude to install extra needed packages). <code><nowiki>sudo aptitude install freenx</nowiki></code></li></ol>
<pre><nowiki>
+
 
deb http://mirror.ubuntulinux.nl/ feisty-seveas freenx
+
deb-src http://mirror.ubuntulinux.nl/ feisty-seveas freenx
+
</nowiki></pre>
+
For Ubuntu 8.04 and 8.10 you could find the necessary information at [https://launchpad.net/~freenx-team/+archive/].
+
Save and then close.
+
For old releases you also have to add the GPG key:
+
<pre><nowiki>
+
wget http://mirror.ubuntulinux.nl/seveas.gpg -O- | sudo apt-key add -
+
</nowiki></pre>
+
Then Update Apt
+
<pre><nowiki>
+
sudo apt-get update
+
</nowiki></pre>
+
After you add the repository, then install the <code><nowiki>freenx</nowiki></code> package.
+
<pre><nowiki>
+
sudo aptitude install freenx
+
</nowiki></pre>
+
(Using aptitude to install extra needed packages)
+
[Note: You can manually perform the setup with: sudo nxsetup --install --setup-nomachine-key]
+
During installation you will be given the option to select NoMachine keys, or custom keys. It is best to select NoMachine keys.
+
 
''For the paranoid: there is an added security risk involved in using the default keys.  If you keep the default keys then everybody will be able to connect to your SSH server as the NX user which is added to your system during the installation.  This opens an additional (and unnecessary) opportunity to attack your computer. You could avoid it by using custom SSH keys, as explained later. ''
 
''For the paranoid: there is an added security risk involved in using the default keys.  If you keep the default keys then everybody will be able to connect to your SSH server as the NX user which is added to your system during the installation.  This opens an additional (and unnecessary) opportunity to attack your computer. You could avoid it by using custom SSH keys, as explained later. ''
On the server, add your user to nxserver
 
<pre><nowiki>
 
sudo nxserver --adduser <username>
 
sudo nxserver --passwd <username>
 
sudo nxserver --restart</nowiki></pre>
 
[Note: I don't know if this is still needed, but it helps - JeremySchroeder]
 
 
=== Installing the NX Client ===
 
=== Installing the NX Client ===
<pre><nowiki>
+
The official NX client is not in the Ubuntu repositories.
sudo aptitude install nxclient
+
You should be able to access your Ubuntu box from any Windows or Linux box using the free client from [http://www.nomachine.com/select-package-client.php NoMachine's website]. You can also embed your NX Server in a webpage by installing the Nomachine Web Companion and the Apache webserver.  
</nowiki></pre>
+
You should be able to access your Ubuntu box from any Windows or Linux box using the free client from [http://www.nomachine.com/download_product.php?Prod_Id=57 NoMachine's website]. You can also embed your NX Server in a webpage by installing the Nomachine Web Companion and the Apache webserver.  
+
(!) Note on nomachine web site there is new version off nxclient version 2.0 and it don't work with freenx so you should better use nxclient from [http://mirror.ubuntulinux.nl/ Seveas' Packages]!
+
 
Now you can execute the installed client using the following command:
 
Now you can execute the installed client using the following command:
 
<pre><nowiki>
 
<pre><nowiki>
第60行: 第34行:
 
This will start the NX client in a GUI, and step you through getting connected to the FreeNX server, and you will be on your way!
 
This will start the NX client in a GUI, and step you through getting connected to the FreeNX server, and you will be on your way!
 
[Note: If you are behind a firewall you may need to enable SSL encryption under the Advanced configuration tab - JeremySchroeder]
 
[Note: If you are behind a firewall you may need to enable SSL encryption under the Advanced configuration tab - JeremySchroeder]
[http://www.nomachine.com/ar/view.php?ar_id=AR07D00407 Useful Resource for installing client on 64-bit Ubuntu]
+
=== Installing QTNX (Opensource client) ===
 +
<pre><nowiki>
 +
sudo apt-get install qtnx</nowiki></pre>
 
== Miscellany ==
 
== Miscellany ==
=== Ubuntu 8.04 LTS: Adjust Font Directory ===
+
=== NX Server Free Edition ===
If the nxclient just exits after successful Authentication, it might be, that you have to adjust the position of the X Font Paths:
+
NX Server Free Edition provided by NoMachine is not related to FreeNX.
Edit /etc/nxserver/node.conf
+
NXSFE has a limit of 2 sessions per server. FreeNX don´t have this limit.
<pre><nowiki>
+
sudoedit /etc/nxserver/node.conf
+
</nowiki></pre>
+
Find the following line (around line 371):
+
<pre><nowiki>
+
#AGENT_EXTRA_OPTIONS_X=""
+
</nowiki></pre>
+
And change it to:
+
<pre><nowiki>
+
AGENT_EXTRA_OPTIONS_X="-fp /usr/share/fonts/X11/misc:/usr/share/X11/fonts/cyrillic:/usr/share/fonts/X11/Type1:/usr/share/X11/fonts/CID:/usr/share/fonts/X11/100dpi:/usr/share/fonts/X11/75dpi:/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType:/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
+
</nowiki></pre>
+
 
=== FreeNX on PowerPC ===
 
=== FreeNX on PowerPC ===
There are no precompiled binaries of FreeNX on this platform, so FreeNX have to be compiled from source. Sources for breezy can be found at SeveasPackages
+
There are no precompiled binaries of FreeNX on this platform (Launchpad PPA don't provide support), so FreeNX have to be compiled from source. Sources can be found at the FreeNX Team PPA.
These steps will build FreeNX from source:
+
These steps will build FreeNX from source (you need to add the deb-src repository):
 
<ol><li>Create a directory to hold the FreeNX source, and cd into it. <pre><nowiki>
 
<ol><li>Create a directory to hold the FreeNX source, and cd into it. <pre><nowiki>
 
mkdir freenxSource; cd freenxSource</nowiki></pre>
 
mkdir freenxSource; cd freenxSource</nowiki></pre>
第90行: 第55行:
 
sudo dpkg -i *.deb</nowiki></pre></li></ol>
 
sudo dpkg -i *.deb</nowiki></pre></li></ol>
  
=== FreeNX on 64bit ===
 
FreeNX is not 64-bit safe, so you will have to build a 32-bit chroot.
 
 
=== How to start/stop FreeNX ===
 
=== How to start/stop FreeNX ===
 
The FreeNX server is not a service but uses ssh. The following command will stop the FreeNX program from accepting connections.
 
The FreeNX server is not a service but uses ssh. The following command will stop the FreeNX program from accepting connections.
 
<pre><nowiki>
 
<pre><nowiki>
sudo nxserver --stop
+
sudo /etc/init.d/freenx stop
 
</nowiki></pre>
 
</nowiki></pre>
(Replace --stop by --start for starting it again)
+
(Replace stop by start for starting it again)
 
=== Configuring SSH port ===
 
=== Configuring SSH port ===
 
By default, nxserver uses port 22 for communicating over SSH. On some machines or networks, port 22 may be blocked; some Internet providers block port 22, for instance.  Port 22 is also a common target of people trying to crack into a network. To make the SSH server listen on port 8888, you can do the following:
 
By default, nxserver uses port 22 for communicating over SSH. On some machines or networks, port 22 may be blocked; some Internet providers block port 22, for instance.  Port 22 is also a common target of people trying to crack into a network. To make the SSH server listen on port 8888, you can do the following:
第111行: 第74行:
 
Try <pre><nowiki>
 
Try <pre><nowiki>
 
/etc/init.d/ssh restart</nowiki></pre>
 
/etc/init.d/ssh restart</nowiki></pre>
 +
FreeNX should detect the SSHD port, but otherwise:
 
Edit the file /etc/nxserver/node.conf
 
Edit the file /etc/nxserver/node.conf
 
<pre><nowiki>
 
<pre><nowiki>
第126行: 第90行:
 
That is, change the port number to the one that sshd is listening to, and uncomment the line.
 
That is, change the port number to the one that sshd is listening to, and uncomment the line.
 
=== Using custom SSH keys ===
 
=== Using custom SSH keys ===
/!\ This is NOT supported by the FreeNX developers - only do this if you have no other option
+
After installation, Freenx will use a set of default ssh keys for authentication.  This is a security risk, especially on any internet-facing machines, and the default keys should be replaced with your own custom keys.
<ol><li>Generate the DSA private-public key pair.  <pre><nowiki>
+
To change the default keys to your own custom keys - on the machine hosting the freenx-server, run the command:
ssh-keygen -t dsa</nowiki></pre> By default this key is places in ~/.ssh/id-dsa. You can leave the passphrase empty, this will not pose a security risk.
+
<pre><nowiki>
</li><li>Install the public key in the FreeNX serving machine. The key should be placed in the file authorized_keys2 in the .ssh dir of the user named nx. <pre><nowiki>
+
sudo dpkg-reconfigure freenx-server
cat ~/.ssh/id_dsa.pub | sudo -u nx tee -a ~nx/.ssh/authorized_keys2</nowiki></pre>
+
</nowiki></pre>
</li><li>Install the private key in the NX client software. When creating a session, press the button labeled "Key" and select your new key in the window that pops up.</li></ol>
+
This will launch a dialogue that will guide you through the generation of custom keys.
 
+
On the first page hit 'OK'
 +
and on the second page select 'Create new custom keys'
 +
a key file called ''client.id_dsa.key'' will be created in:
 +
''/var/lib/nxserver/home/custom_keys/''
 +
First copy the key to your home directory:
 +
<pre><nowiki>
 +
sudo cp /var/lib/nxserver/home/custom_keys/client.id_dsa.key ~/
 +
</nowiki></pre>
 +
Next, copy ''client.id_dsa.key'' to your client machine. Ideally you should copy the file securely, for example by running the following command from the client computer:
 +
<pre><nowiki>
 +
scp user@freenx-server:~/client.id_dsa.key ~/
 +
</nowiki></pre>
 +
which will securely copy the client.id_dsa.key file from the freenx-server computer to your home directory on the client.
 +
In the nx client software you can now import this key.
 +
After you have tested that authentication is working using your custom keys you should then remove the client.id_dsa.key file from your home directories on both the server and client machines.
 
== References ==
 
== References ==
 
* [http://en.wikipedia.org/wiki/FreeNX FreeNX on Wikipedia]
 
* [http://en.wikipedia.org/wiki/FreeNX FreeNX on Wikipedia]

2008年12月16日 (二) 18:36的版本


What is FreeNX

FreeNX is a system that allows you to access your desktop from another machine over the internet. You can use this to login graphically to your desktop from a remote location. One example of its use would be to have a FreeNX server set up on your home computer, and graphically logging in to the home computer from your work computer, using a FreeNX client. It's Open Source, secure (SSH based), fast and versatile! Note: Running FreeNX as server on Ubuntu with the free "NX Client for Windows" from NoMachine on a Windows workstation is working fine.

Terminology

The Server is the computer you want to connect to. This is the computer where the FreeNX server will need to be installed. The name of the Ubuntu package providing the server is "freenx". For the example used here, the home computer is the server. The Client is the computer from which you want to be able to access the Server. The name of the Ubuntu package providing the client is "nxclient". For the example used here, the work computer is the client.

Installation

Installing the FreeNX server

We will be installing the FreeNX server on the Server machine, i.e., the machine that you want to access remotely. In the stated example, this is your computer that is at home. FreeNX is not included in Ubuntu, so we'll add it from the FreeNX Team PPA. Add this repository using the Third-Party Sources Tab in Software Sources. When it asks, Reload the information about available software. Now you can see and install the `freenx` package in Synaptic Package Manager. Alternatively, you can edit the configuration files and install by hand:

  1. Open your apt sources list
    gksudo gedit /etc/apt/sources.list
    
    and append the two lines for the repository
     
    

    deb http://ppa.launchpad.net/freenx-team/ubuntu VERSION main deb-src http://ppa.launchpad.net/freenx-team/ubuntu VERSION main

    where VERSION can be: dapper, hardy or intrepid. More information can be found at FreeNX Team PPA.
  2. Save and then close.
  3. Then Update Apt sudo apt-get update
  4. After you add the repository, then install the freenx package (using Aptitude to install extra needed packages). sudo aptitude install freenx

For the paranoid: there is an added security risk involved in using the default keys. If you keep the default keys then everybody will be able to connect to your SSH server as the NX user which is added to your system during the installation. This opens an additional (and unnecessary) opportunity to attack your computer. You could avoid it by using custom SSH keys, as explained later.

Installing the NX Client

The official NX client is not in the Ubuntu repositories. You should be able to access your Ubuntu box from any Windows or Linux box using the free client from NoMachine's website. You can also embed your NX Server in a webpage by installing the Nomachine Web Companion and the Apache webserver. Now you can execute the installed client using the following command:

/usr/NX/bin/nxclient &

Or by looking it up in the menu This will start the NX client in a GUI, and step you through getting connected to the FreeNX server, and you will be on your way! [Note: If you are behind a firewall you may need to enable SSL encryption under the Advanced configuration tab - JeremySchroeder]

Installing QTNX (Opensource client)

sudo apt-get install qtnx

Miscellany

NX Server Free Edition

NX Server Free Edition provided by NoMachine is not related to FreeNX. NXSFE has a limit of 2 sessions per server. FreeNX don´t have this limit.

FreeNX on PowerPC

There are no precompiled binaries of FreeNX on this platform (Launchpad PPA don't provide support), so FreeNX have to be compiled from source. Sources can be found at the FreeNX Team PPA. These steps will build FreeNX from source (you need to add the deb-src repository):

  1. Create a directory to hold the FreeNX source, and cd into it.
    mkdir freenxSource; cd freenxSource
  2. Build the freenx pacakges and install related packages.
    sudo apt-get build-dep nx freenx
    apt-get -b source nx freenx
    This will download the souce tarballs and build the freenx packages (*.deb) in the current directory.
  3. Install the FreeNX packages.
    sudo dpkg -i *.deb
  4. If dpkg complains about missing packages, let apt fix it
    sudo apt-get -f install
    sudo dpkg -i *.deb

How to start/stop FreeNX

The FreeNX server is not a service but uses ssh. The following command will stop the FreeNX program from accepting connections.

sudo /etc/init.d/freenx stop

(Replace stop by start for starting it again)

Configuring SSH port

By default, nxserver uses port 22 for communicating over SSH. On some machines or networks, port 22 may be blocked; some Internet providers block port 22, for instance. Port 22 is also a common target of people trying to crack into a network. To make the SSH server listen on port 8888, you can do the following: Edit the file /etc/ssh/sshd_config

gksudo gedit /etc/ssh/sshd_config
Find
Port 22
and change it to
Port 8888

You then need to restart SSHD.

Try
/etc/init.d/ssh restart

FreeNX should detect the SSHD port, but otherwise: Edit the file /etc/nxserver/node.conf

gksudo gedit /etc/nxserver/node.conf
Find
# The port number where local 'sshd' is listening.
#SSHD_PORT=22

and change it to:

# The port number where local 'sshd' is listening.
SSHD_PORT=8888

That is, change the port number to the one that sshd is listening to, and uncomment the line.

Using custom SSH keys

After installation, Freenx will use a set of default ssh keys for authentication. This is a security risk, especially on any internet-facing machines, and the default keys should be replaced with your own custom keys. To change the default keys to your own custom keys - on the machine hosting the freenx-server, run the command:

sudo dpkg-reconfigure freenx-server

This will launch a dialogue that will guide you through the generation of custom keys. On the first page hit 'OK' and on the second page select 'Create new custom keys' a key file called client.id_dsa.key will be created in: /var/lib/nxserver/home/custom_keys/ First copy the key to your home directory:

sudo cp /var/lib/nxserver/home/custom_keys/client.id_dsa.key ~/

Next, copy client.id_dsa.key to your client machine. Ideally you should copy the file securely, for example by running the following command from the client computer:

scp user@freenx-server:~/client.id_dsa.key ~/

which will securely copy the client.id_dsa.key file from the freenx-server computer to your home directory on the client. In the nx client software you can now import this key. After you have tested that authentication is working using your custom keys you should then remove the client.id_dsa.key file from your home directories on both the server and client machines.

References

Related docs

You can also have a look at the article about installing the |NX packages provided by NoMachine company