个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
安装FreeNX服务端
Installing the NX Client
第66行: 第66行:
 
[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 ==
 +
=== Ubuntu 8.04 LTS: Adjust Font Directory ===
 +
If the nxclient just exits after successful Authentication, it might be, that you have to adjust the position of the X Font Paths:
 +
Edit /etc/nxserver/node.conf
 +
<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 ===
 +
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:
 +
<ol><li>Create a directory to hold the FreeNX source, and cd into it. <pre><nowiki>
 +
mkdir freenxSource; cd freenxSource</nowiki></pre>
 +
</li><li>Build the freenx pacakges and install related packages. <pre><nowiki>
 +
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.
 +
</li><li>Install the FreeNX packages. <pre><nowiki>
 +
sudo dpkg -i *.deb</nowiki></pre>
 +
</li><li>If dpkg complains about missing packages, let apt fix it <pre><nowiki>
 +
sudo apt-get -f install
 +
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 ===
 +
The FreeNX server is not a service but uses ssh. The following command will stop the FreeNX program from accepting connections.
 +
<pre><nowiki>
 +
sudo nxserver --stop
 +
</nowiki></pre>
 +
(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
 +
<pre><nowiki>
 +
gksudo gedit /etc/ssh/sshd_config
 +
</nowiki></pre>
 +
Find <pre><nowiki>
 +
Port 22</nowiki></pre>
 +
and change it to <pre><nowiki>
 +
Port 8888</nowiki></pre>
 +
You then need to restart SSHD.
 +
Try <pre><nowiki>
 +
/etc/init.d/ssh restart</nowiki></pre>
 +
Edit the file /etc/nxserver/node.conf
 +
<pre><nowiki>
 +
gksudo gedit /etc/nxserver/node.conf
 +
</nowiki></pre>
 +
Find <pre><nowiki>
 +
# The port number where local 'sshd' is listening.
 +
#SSHD_PORT=22
 +
</nowiki></pre>
 +
and change it to:
 +
<pre><nowiki>
 +
# The port number where local 'sshd' is listening.
 +
SSHD_PORT=8888
 +
</nowiki></pre>
 +
That is, change the port number to the one that sshd is listening to, and uncomment the line.
 +
=== Using custom SSH keys ===
 +
/!\ This is NOT supported by the FreeNX developers - only do this if you have no other option
 +
<ol><li>Generate the DSA private-public key pair.  <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.
 +
</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>
 +
cat ~/.ssh/id_dsa.pub | sudo -u nx tee -a ~nx/.ssh/authorized_keys2</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>

2008年11月3日 (一) 01:53的版本


FreeNX 是什么

FreeNX 是一个允许你通过互联网从另外一台电脑进入你桌面的系统。你可以用此系统来进行远程的图形界面登录。比方说它可以用于:在你的家用电脑上装好FreeNX服务端,然后就可以用FreeNX客户端从你的工作电脑来图形登录到家用电脑上。它是开源的、安全(基于SSH)、快捷并且用途广泛!注意:目前FreeNX还仅限于本地和远程机器的桌面环境是Linux或Unix。在Ubuntu上运行FreeNX为服务端并在Windows中配合使用NoMachine的免费"NX Client for Windows",也能运行良好。

术语

服务器(server)是你想接入的电脑。此电脑也就应该安装FreeNX服务端程序。提供服务端的Ubuntu包叫"freenx"。对前面的举例而言,家用电脑就是服务器。 客户端(client)是指你准备接入"服务器"的那台电脑。提供客户端的Ubuntu包叫"nxclient"。对前面的例子而言,工作电脑是客户端。

安装

安装FreeNX服务端

我们将在提供服务的电脑上安装FreeNX服务端,即那台你想远程登录的机器。在前面举例中指那台你家中的电脑。打开你的aptitude源列表在文件内容后加上两行。

gksudo gedit /etc/apt/sources.list

对于Ubuntu 5.10 和 6.06,请加入:

 
deb http://mirror.ubuntulinux.nl/ dapper-seveas freenx
deb-src hhttp://mirror.ubuntulinux.nl/ dapper-seveas freenx

对于Ubuntu 7.04,请加入:

 
deb http://mirror.ubuntulinux.nl/ feisty-seveas freenx
deb-src http://mirror.ubuntulinux.nl/ feisty-seveas freenx

对于Ubuntu 8.04 和 8.10 你可以在[1]找到相关信息。 保存并关闭列表。对于更老的发行版还必须加上GPC key:

wget http://mirror.ubuntulinux.nl/seveas.gpg -O- | sudo apt-key add -

然后更新apt

sudo apt-get update

在添加源后安装freenx 包。

sudo aptitude install freenx

(利用aptitude来安装依赖包) [注:你也可以用sudo nxsetup --install --setup-nomachine-key 来手动执行安装] 在安装过程中会让你选择NoMachine keys还是custom keys。最好是选NoMachine keys。 说给paranoid:利用默认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. 在服务器上,在nxserver中添加你的用户

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

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

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

Ubuntu 8.04 LTS: Adjust Font Directory

If the nxclient just exits after successful Authentication, it might be, that you have to adjust the position of the X Font Paths: Edit /etc/nxserver/node.conf

sudoedit /etc/nxserver/node.conf

Find the following line (around line 371):

#AGENT_EXTRA_OPTIONS_X=""

And change it to:

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"

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

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)

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

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

/!\ 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.
  2. 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
  3. 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.