Ubuntu10.04 常用配置

一、网络设定:
VMware IP地址自动获取:
VM-->Settings->Network Adapter 默认使用NAT(share host's IP)修改成Bridged(connect direct to physical network)


A、以DHCP方式配置网卡


编辑文件/etc/network/interfaces:
sudo gedit /etc/network/interfaces


并用下面的行来替换有关eth0的行:
# The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp


用下面的命令使网络设置生效:
sudo /etc/init.d/networking restart
也可以在命令行下直接输入下面的命令来获取地址


sudo dhclient eth0


B、如果修改成为网卡配置静态IP地址


编辑文件/etc/network/interfaces:


sudo vi /etc/network/interfaces


并用下面的行来替换有关eth0的行:# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
#network 192.168.3.0
#broadcast 192.168.3.255


将上面的ip地址等信息换成你自己就可以了.用下面的命令使网络设置生效:
sudo /etc/init.d/networking restart


要访问DNS 服务器来进行查询,需要设置/etc/resolv.conf文件.
nameserver 192.168.10.245
nameserver 192.168.10.247
nameserver 192.168.10.248


二、网络代理设定


Ubuntu 10.04
System(系统) - Preferences(首先项) - Network Proxy(网络代理)工具来配置。


以上设定完成以后:/etc/apt/apt.conf 内容变为:


Acquire::http::proxy "http://192.168.10.245:3128/";
Acquire::ftp::proxy "ftp://192.168.10.245:3128/";
Acquire::https::proxy "https://192.168.10.245:3128/";


或者直接修改此文件也可以


此时网络代码将生效


三、apt-get instal 安装软件

源地址记录在文件: /etc/apt/sources.list 


首先配置下载源地址:【需求针对不同的ubuntu版本而定,下面给定的为ubuntu10.04版本】


台湾源不错:
deb http://Ubuntu.cn99.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid main universe restricted multiverse
deb http://Ubuntu.cn99.com/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://Ubuntu.cn99.com/ubuntu/ lucid-updates universe main multiverse restricted
deb http://Ubuntu.cn99.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://Ubuntu.cn99.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-updates universe main multiverse restricted


更新源,其实也就是更新其上面的头文件,带有可以下载的软件名称及版本等


sudo apt-get update


四、nfs 配置


安装服务端软件:
$sudo apt-get install nfs-kernel-server
$sudo apt-get install nfs-common


配置 nfs 路径:
$sudo gedit /etc/exports
"/nfsdir *(rw,no_root_squash,no_all_squash)"


启动服务:
$sudo /etc/init.d/nfs-kernel-server start


注意点:
Privileges is very important so when running from NFS please make sure that you have the 
   option "no_root_squash" in /etc/exports, eg:
    /nfsdir     *(rw,no_root_squash,no_all_squash)

利用nfs调试时,一般命令如下:

root=/dev/nfs nfsroot=192.168.44.103:/home/user/nfsdir , bmem=128@128M ip=dhcp rw ,nolock init=/init

在ip前面千万不要加 "," 号,否则kernel解析命令出错,mount nfs时失败@@@@ 小小的逗号害人哟。

Looking up port of RPC 100005/1 on 192.168.30.54

rpcbind: server 192.168.30.54 not responding, timed out


五、samba 服务配置 (共享群组可读写文件夹)


Samba install:
sudo apt-get install samba samba-common-bin system-config-samba smbfs smbclient


建立用户及密码
系统->管理->用户和组 添加


添加网络使用者的帐号
sudo smbpasswd -a smbuser


sudo gedit /etc/samba/smb.conf
找到下关键字:; security = user
用这几行取代: security = share


将下列几行新增到文件的最后面,假设允许访问的用户为: smbuser 
而文件夹的共享名为 ShareFolder
[ShareFolder]
comment = Shared Folder with username and password
path = /home/smbuser/
public = yes
writable = yes
valid users = messcode
create mask = 0700
directory mask = 0700
force user = nobody
force group = nogroup
available = yes
browseable = yes


找到[global]把 workgroup = MSHOME 改成
workgroup = WORKGROUP
display charset = UTF-8
unix charset = UTF-8
dos charset = cp936
后面的三行是为了防止出现中文目录乱码的情况


启动服务:
sudo /etc/init.d/smbd restart


六、远程 ssh 登录配置


Change shell from dash to bash
$ls -al /bin/sh
$sudo dpkg-reconfigure dash


sudo apt-get install openssh-server


设置无密码登录本机
生成密码对
$ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
再把 id_dsa.pub 追加到授权 key 里面
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys 


测试ssh localhost
~$ ssh localhost  .... 选择 yes


利用ssh登录显示:
Linux ubuntu 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
Ubuntu 10.04 LTS


Welcome to Ubuntu!
 * Documentation:  https://help.ubuntu.com/


4 packages can be updated.
0 updates are security updates.




The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.


Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.


如何开启root用户登录:root用户默认是不开启的,开启后也是不能从登陆界面直接用root用户登陆


开启: sudo passwd root;
禁用:sudo passwd -l root;




七、tftp 服务器配置


tftp install
Install "xinetd", "tftpd" and "tftp" using apt-get:
$sudo apt-get install xinetd tftpd tftp


Create tftpd config file if it is not exist, edit it as below :
$sudo vi /etc/xinetd.d/tftpd


service tftp
{
 protocol = udp
 port = 69
 socket_type = dgram
 wait = yes
 user = nobody
 server = /usr/sbin/in.tftpd
 server_args = /tftpboot
 disable = no
}


Create tftp directory and change permission and owner :
$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody /tftpboot
$ sudo /etc/init.d/xinetd restart

八、android编译


Install utilities for buiding android :
$sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev


* use sudo without password 
$sudo gedit  /etc/sudoers
USERNAME ALL=(ALL) NOPASSWD: ALL

e.x.) kwlee ALL=(ALL) NOPASSWD: ALL


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值