特殊:Badtitle/NS100:FreeNX:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
第2行: 第2行:
{{Languages|UbuntuHelp:FreeNX}}
{{Languages|UbuntuHelp:FreeNX}}
[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.
'''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:''' 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.
=== 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.
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.
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.
=== 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. Open your aptitude sources list and append the two lines for the repository.  
第16行: 第11行:
gksudo gedit /etc/apt/sources.list
gksudo gedit /etc/apt/sources.list
</nowiki></pre>
</nowiki></pre>
For Ubuntu 5.10 and 6.06, they are:
For Ubuntu 5.10 and 6.06, they are:
<pre><nowiki>  
<pre><nowiki>  
第22行: 第16行:
deb-src http://free.linux.hp.com/~brett/seveas/freenx dapper-seveas freenx
deb-src http://free.linux.hp.com/~brett/seveas/freenx dapper-seveas freenx
</nowiki></pre>
</nowiki></pre>
For Ubuntu 7.04, they are:
For Ubuntu 7.04, they are:
<pre><nowiki>  
<pre><nowiki>  
第28行: 第21行:
deb-src http://free.linux.hp.com/~brett/seveas/freenx feisty-seveas freenx
deb-src http://free.linux.hp.com/~brett/seveas/freenx feisty-seveas freenx
</nowiki></pre>
</nowiki></pre>
(For future versions, visit the [http://free.linux.hp.com/~brett/seveas/freenx FreeNX repository] site to check for other repositories.)
(For future versions, visit the [http://free.linux.hp.com/~brett/seveas/freenx FreeNX repository] site to check for other repositories.)
Save and then close.
Save and then close.
Add the GPG key:
Add the GPG key:
<pre><nowiki>
<pre><nowiki>
wget http://free.linux.hp.com/~brett/seveas/freenx/seveas.gpg -O- | sudo apt-key add -
wget http://free.linux.hp.com/~brett/seveas/freenx/seveas.gpg -O- | sudo apt-key add -
</nowiki></pre>
</nowiki></pre>
Then Update Apt
Then Update Apt
<pre><nowiki>
<pre><nowiki>
sudo apt-get update
sudo apt-get update
</nowiki></pre>
</nowiki></pre>
After you add the repository, then install the <code><nowiki>freenx</nowiki></code> package.
After you add the repository, then install the <code><nowiki>freenx</nowiki></code> package.
<pre><nowiki>
<pre><nowiki>
sudo aptitude install freenx
sudo aptitude install freenx
第52行: 第37行:
(Using aptitude to install extra needed packages)
(Using aptitude to install extra needed packages)
[Note: You can manually perform the setup with: sudo nxsetup --install --setup-nomachine-key]
[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.
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 absolutely NO added security risk involved in using the default keys. Read an [http://en.wikipedia.org/wiki/Secure_Sockets_Layer SSL] primer if you want to know the details about why this is the case''
''For the paranoid: there is no added security risk involved in using the default keys. Read an [http://en.wikipedia.org/wiki/Secure_Sockets_Layer SSL] primer if you want to know the details about why this is the case.  Also see http://mail.kde.org/pipermail/freenx-knx/2005-August/001900.html.''
 
(I am not so sure about that ''<u>absolutely NO</u> added security risk''; anyway, official word seems to be that this is a non-issue: see http://mail.kde.org/pipermail/freenx-knx/2005-August/001900.html )
 
On the server, add your user to nxserver
On the server, add your user to nxserver
<pre><nowiki>sudo nxserver --adduser <username>
<pre><nowiki>sudo nxserver --adduser <username>
第63行: 第44行:
sudo nxserver --restart</nowiki></pre>
sudo nxserver --restart</nowiki></pre>
[Note: I don't know if this is still needed, but it helps - JeremySchroeder]
[Note: I don't know if this is still needed, but it helps - JeremySchroeder]
==== Configuring SSH ====
==== Configuring SSH ====
By default, nxserver uses port 22 for communicating over SSH. On some machines or networks, port 22 may be blocked. For example, some providers block port 22. 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:
 
Edit the file /etc/ssh/sshd_config
Edit the file /etc/ssh/sshd_config
<pre><nowiki>
<pre><nowiki>
gksudo gedit /etc/ssh/sshd_config
gksudo gedit /etc/ssh/sshd_config
</nowiki></pre>
</nowiki></pre>
Find  
Find  
<pre><nowiki>
<pre><nowiki>
Port 22</nowiki></pre>
Port 22</nowiki></pre>
and change it to  
and change it to  
<pre><nowiki>
<pre><nowiki>
Port 8888</nowiki></pre>
Port 8888</nowiki></pre>
You then need to restart SSHD.  
You then need to restart SSHD.  
Try  
Try  
<pre><nowiki>
<pre><nowiki>
/etc/init.d/ssh restart</nowiki></pre>
/etc/init.d/ssh restart</nowiki></pre>
Edit the file /etc/nxserver/node.conf
Edit the file /etc/nxserver/node.conf
<pre><nowiki>
<pre><nowiki>
gksudo gedit /etc/nxserver/node.conf
gksudo gedit /etc/nxserver/node.conf
第97行: 第69行:
#SSHD_PORT=22
#SSHD_PORT=22
</nowiki></pre>
</nowiki></pre>
and change it to:
and change it to:
<pre><nowiki>
<pre><nowiki>
第103行: 第74行:
SSHD_PORT=8888
SSHD_PORT=8888
</nowiki></pre>
</nowiki></pre>
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.
=== Installing the NX Client ===
=== Installing the NX Client ===
<pre><nowiki>
<pre><nowiki>
sudo aptitude install nxclient
sudo aptitude install nxclient
</nowiki></pre>
</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.  
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=23 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://free.linux.hp.com/~brett/seveas/freenx/ Seveas' Packages]!
(!) 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://free.linux.hp.com/~brett/seveas/freenx/ 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>
/usr/NX/bin/nxclient &</nowiki></pre>
/usr/NX/bin/nxclient &</nowiki></pre>
Or by looking it up in the menu
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!
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]
[http://www.nomachine.com/ar/view.php?ar_id=AR07D00407 Useful Resource for installing client on 64-bit Ubuntu]
=== Miscellany ===
=== Miscellany ===
==== 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, so FreeNX have to be compiled from source. Sources for breezy can be found at SeveasPackages
These steps will build FreeNX from source:
These steps will build FreeNX from source:
 
# Create a directory to hold the FreeNX source, and cd into it.  
* Create a directory to hold the FreeNX source, and cd into it.  
<pre><nowiki>
<pre><nowiki>
mkdir freenxSource; cd freenxSource</nowiki></pre>
mkdir freenxSource; cd freenxSource</nowiki></pre>
* Build the freenx pacakges and install related packages.  
# Build the freenx pacakges and install related packages.  
<pre><nowiki>
<pre><nowiki>
sudo apt-get build-dep nx freenx
sudo apt-get build-dep nx freenx
apt-get -b source nx freenx</nowiki></pre> This will download the souce tarballs and build the freenx packages (*.deb) in the current directory.
apt-get -b source nx freenx</nowiki></pre> This will download the souce tarballs and build the freenx packages (*.deb) in the current directory.
* Install the FreeNX packages.  
# Install the FreeNX packages.  
<pre><nowiki>
<pre><nowiki>
sudo dpkg -i *.deb</nowiki></pre>
sudo dpkg -i *.deb</nowiki></pre>
* If dpkg complains about missing packages, let apt fix it  
# If dpkg complains about missing packages, let apt fix it  
<pre><nowiki>
<pre><nowiki>
sudo apt-get -f install
sudo apt-get -f install
sudo dpkg -i *.deb</nowiki></pre>
sudo dpkg -i *.deb</nowiki></pre>
==== FreeNX on 64bit ====
==== FreeNX on 64bit ====
FreeNX is not 64-bit safe, so you will have to build a 32-bit chroot.
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 nxserver --stop
</nowiki></pre>
</nowiki></pre>
(Replace --stop by --start for starting it again)
(Replace --stop by --start for starting it again)
==== 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
/!\ This is NOT supported by the FreeNX developers - only do this if you have no other option
 
# Generate the DSA private-public key pair.   
* Generate the DSA private-public key pair.   
<pre><nowiki>
<pre><nowiki>
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.
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.
* 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.  
# 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>
<pre><nowiki>
cat ~/.ssh/id_dsa.pub | sudo -u nx tee -a ~nx/.ssh/authorized_keys2</nowiki></pre>
cat ~/.ssh/id_dsa.pub | sudo -u nx tee -a ~nx/.ssh/authorized_keys2</nowiki></pre>
* 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.
# 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.
 
=== References ===
=== References ===
* [http://en.wikipedia.org/wiki/FreeNX FreeNX on Wikipedia]
* [http://en.wikipedia.org/wiki/FreeNX FreeNX on Wikipedia]
* [http://free.linux.hp.com/~brett/seveas/freenx/ Seveas' Packages] FreeNX repository
* [http://free.linux.hp.com/~brett/seveas/freenx/ Seveas' Packages] FreeNX repository
* [http://ubuntuforums.org/showthread.php?t=467219 Ubuntu Forums HowTo FreeNx] ''How to remote desktop using SSH and FreeNX - OpenGL Seveas Repositories''
* [http://ubuntuforums.org/showthread.php?t=467219 Ubuntu Forums HowTo FreeNx] ''How to remote desktop using SSH and FreeNX - OpenGL Seveas Repositories''
----
----
[[category:CategoryDocumentation]]
[[category:CategoryDocumentation]]


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2007年11月30日 (五) 17:22的版本

{{#ifexist: :FreeNX/zh | | {{#ifexist: FreeNX/zh | | {{#ifeq: {{#titleparts:FreeNX|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:FreeNX|1|-1|}} | zh | | }}

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. 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 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.

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.

gksudo gedit /etc/apt/sources.list

For Ubuntu 5.10 and 6.06, they are:

 
deb http://free.linux.hp.com/~brett/seveas/freenx dapper-seveas freenx
deb-src http://free.linux.hp.com/~brett/seveas/freenx dapper-seveas freenx

For Ubuntu 7.04, they are:

 
deb http://free.linux.hp.com/~brett/seveas/freenx feisty-seveas freenx
deb-src http://free.linux.hp.com/~brett/seveas/freenx feisty-seveas freenx

(For future versions, visit the FreeNX repository site to check for other repositories.) Save and then close. Add the GPG key:

wget http://free.linux.hp.com/~brett/seveas/freenx/seveas.gpg -O- | sudo apt-key add -

Then Update Apt

sudo apt-get update

After you add the repository, then install the freenx package.

sudo aptitude install freenx

(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 no added security risk involved in using the default keys. Read an SSL primer if you want to know the details about why this is the case. Also see http://mail.kde.org/pipermail/freenx-knx/2005-August/001900.html. On the server, add your user to nxserver

sudo nxserver --adduser <username>
sudo nxserver --passwd <username>
sudo nxserver --restart

[Note: I don't know if this is still needed, but it helps - JeremySchroeder]

Configuring SSH

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

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.

Installing the NX Client

sudo aptitude install nxclient

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. (!) 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 Seveas' Packages! 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] Useful Resource for installing client on 64-bit Ubuntu

Miscellany

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 These steps will build FreeNX from source:

  1. Create a directory to hold the FreeNX source, and cd into it.
mkdir freenxSource; cd freenxSource
  1. 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.

  1. Install the FreeNX packages.
sudo dpkg -i *.deb
  1. If dpkg complains about missing packages, let apt fix it
sudo apt-get -f install
sudo dpkg -i *.deb

FreeNX on 64bit

FreeNX is not 64-bit safe, so you will have to build a 32-bit chroot.

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 nxserver --stop

(Replace --stop by --start for starting it again)

Using custom SSH keys

/!\ This is NOT supported by the FreeNX developers - only do this if you have no other option

  1. Generate the DSA private-public key pair.
ssh-keygen -t dsa

By default this key is places in ~/.ssh/id-dsa. You can leave the passphrase empty, this will not pose a security risk.

  1. 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.
cat ~/.ssh/id_dsa.pub | sudo -u nx tee -a ~nx/.ssh/authorized_keys2
  1. 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.

References