Chinaunix首页 | 论坛 | 博客
  • 博客访问: 66886
  • 博文数量: 11
  • 博客积分: 310
  • 博客等级: 一等列兵
  • 技术积分: 105
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-23 23:41
文章分类

全部博文(11)

文章存档

2012年(7)

2011年(2)

2010年(2)

分类: LINUX

2010-08-20 12:46:00



sudo gedit /etc/apt/sources.list(源)

deb lucid main universe restricted multiverse
deb-src lucid main universe restricted multiverse
deb lucid-security universe main multiverse restricted
deb-src lucid-security universe main multiverse restricted
deb lucid-updates universe main multiverse restricted
deb lucid-proposed universe main multiverse restricted
deb-src lucid-proposed universe main multiverse restricted
deb lucid-backports universe main multiverse restricted
deb-src lucid-backports universe main multiverse restricted
deb-src lucid-updates universe main multiverse restricted


sudo apt-get update(更新源)

sudo gedit /etc/apt/apt.conf  (更新源)

Acquire::http::Proxy "";
Acquire::http::Proxy "";
Acquire::http::Proxy "";

sudo apt-get install vnc4server

vnc4server

sudo gedit /home/stu/.vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 1024x768+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &


vnc4server -kill :1

vnc4server


sudo gedit /home/stu/.vncrc



#配置X系统为xorg
$XFconfigPath = "/etc/X11/xorg.conf";

# 启动默认Xsession
$vncStartup = "/etc/X11/Xsession";

#分辨率
$geometry ="800x600";




vnc4server -kill :1

vnc4server


sudo gedit /etc/default/rcS

#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.

TMPTIME=0
SULOGIN=no
DELAYLOGIN=no
UTC=no
VERBOSE=no
FSCKFIX=no


ubuntu10.04安装NX
1. 下载:


(1) NX Desktop Server DEB for Linux
(2) NX Node DEB for Linux
(3) NX Client DEB for Linux

另:对于centos,则下载rpm包


2. 安装

(1) 注:如果之前装过FreeNX或者NX,都要卸掉
一定要按照以下的顺序安装包,既可以双击下载到的deb包,也可以用命令行:
sudo dpkg -i file/path/filename.deb

另:对于centos,安装命令为rpm -i file.rpm


(2) 顺序:
nxclient
nxnode
nxserver
注:中途可能会出现由于PRINT或者其他权限的东西,按照提示,安装缺失的包或者执行命令即可。


判断是否安装ssh 服务

ssh localhost

如果执行结果显示

ssh : connect to host localhost port 22 : Connection refused

则表示ssh 服务还没有安装,可以通过以下命令安装:

sudo apt-get install openssh-server
安装完成后,查看ssh 服务是否正常运行
sudo /etc/init.d/ssh status

 配置ssh
sudo vim /etc/ssh/sshd_config
添加行:
AuthorizedKeysFile /usr/NX/home/nx/.ssh/authorized_keys2
(如果有,可能是以前装过,要注释掉)

#另:如果使用了putty的Key,或者是有其他的key,那么就可以把/usr/NX/home/nx/.ssh/authorized_keys2里的公钥加到以前的认证

key文件中即可,此行也就不用添加了。但是要enable 这行:#AuthorizedKeysFile     .ssh/authorized_keys
(饿,这个办法在centos中全部通用key的没有搞定,ubuntu的可以哦)

重启并确认:

i. 重启:
sudo /etc/init.d/ssh restart

ii. 确认能正常运行:
sudo /usr/NX/bin/nxserver --status
如果能得到以下信息,就可以了:
NX> 900 Connecting to server ..
NX> 110 NX Server is running.
NX> 999 Bye.

 更改nx配置文件

i. 修改server配置文件:
sudo vim /usr/NX/etc/server.cfg
去掉以下两行的注释,并改值:
EnableAutokillSessions = "1"-------->能删掉很old的进程
EnableUnencryptedSession = "0"------>加密

另:想以root登录的话,改:EnableAdministratorLogin = "1"

ii. 修改client配置文件:
sudo vim /usr/NX/etc/node.cfg
去掉下行的注释并修改值:
EnableUnencryptedSession = "0"------>加密

iii. 重启
sudo /usr/NX/bin/nxserver --restart

 在Windows上打开NXClient输入相关参数就可以连接Linux Server了。
 如果你用 root 账号的话是无法登陆的,这时你可以运行以下命令新建一个用户

    # cd /usr/NX/bin/ [进入NX目录]
    # ./nxserver --useradd yourname --system  [新建系统用户 回车设置密码]
    # nxserver --restart  [重启NX服务]



我的机器有两个网卡,一个连接内网, 一个连接外网。不管是在 Windows 下还是在 Ubuntu 下,都有这样一个现象:如果两个网卡同时连上,所有的连接都会尝试走内网,使得我无法访问 Internet。

在 Windows 下有一个解决方法,就是去掉内网的网关。这样既没有断开内网,又能够上外网。但是在 Ubuntu 下,网络设置当中网关不能为空。怎么办呢?

搜索论坛发现,其实这是可以选择的。当系统启用了多个网卡时,Ubuntu 会使用 “default gateway”(缺省网关) 指定的网卡来连接。

比如我的两个网卡 IP/网关分别为(* 是我有意省略的):
eth0 - 202.197.40.*/202.197.40.254
eth1 - 172.16.33.*/172.16.33.254

键入 route 命令即可查看缺省网关。

 

要添加缺省网关,可以用类似下面的命令:

sudo route add default gw 202.197.40.254

 

缺省网关可以有多个。要删除多余的缺省网关,可以用类似下面的命令:

sudo route del default gw 172.16.33.254

 

做了这样的配置后,现在我既能访问内网,又能访问外网了。




deb maverick main restricted universe multiverse
deb maverick-security main restricted universe multiverse
deb maverick-updates main restricted universe multiverse
deb maverick-proposed main restricted universe multiverse
deb maverick-backports main restricted universe multiverse
deb-src maverick main restricted universe multiverse
deb-src maverick-security main restricted universe multiverse
deb-src maverick-updates main restricted universe multiverse
deb-src maverick-proposed main restricted universe multiverse
deb-src maverick-backports main restricted universe multiverse
deb maverick main restricted universe multiverse
deb maverick-security main restricted universe multiverse
deb maverick-updates main restricted universe multiverse
deb maverick-proposed main restricted universe multiverse
deb maverick-backports main restricted universe multiverse
deb-src maverick main restricted universe multiverse
deb-src maverick-security main restricted universe multiverse
deb-src maverick-updates main restricted universe multiverse
deb-src maverick-proposed main restricted universe multiverse
deb-src maverick-backports main restricted universe multiverseo

#LUPA的源,速度也很好的(开源社区)
deb maverick main restricted universe multiverse
deb maverick-security main restricted universe multiverse
deb maverick-updates main restricted universe multiverse
deb maverick-backports main restricted universe multiverse
deb maverick-proposed main restricted universe multiverse
deb-src maverick main restricted universe multiverse
deb-src maverick-security main restricted universe multiverse
deb-src maverick-updates main restricted universe multiverse
deb-src maverick-backports main restricted universe multiverse
deb-src maverick-proposed main restricted universe multiverse




阅读(2150) | 评论(1) | 转发(0) |
0

上一篇:没有了

下一篇:从ip地址冲突找根源

给主人留下些什么吧!~~

chinaunix网友2010-08-24 09:00:21

Download More than 1000 free IT eBooks: http://free-ebooks.appspot.com