博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu10.04 常用配置
阅读量:2260 次
发布时间:2019-05-09

本文共 5392 字,大约阅读时间需要 17 分钟。

一、网络设定:
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

转载地址:http://hqdcb.baihongyu.com/

你可能感兴趣的文章
Android开发:canvas.drawTextOnPath()无效
查看>>
Android上掌纹识别第一步:基于OpenCV的6种肤色分割 源码和效果图
查看>>
Runnable 并不一定是新开一个线程
查看>>
Java初始化(构造函数)
查看>>
vs2008 试用版评估期结束的解决方法
查看>>
Visual Studio Team System
查看>>
Android之SurfaceView学习(一)
查看>>
eclipse启动不起来,eclipse.ini配置问题(支持大内存64bit问题)
查看>>
能不能用system.out.print();代替e.printStackTrace();呢?
查看>>
在内部类中可以访问其外部类的所有域,即使是私有域
查看>>
ReflectUtil
查看>>
如何用adb命令启动你的Android程序
查看>>
哪位高手能给个Java的IO流类的层次结构呵~
查看>>
UART通信
查看>>
Ubuntu下挂载U盘
查看>>
15.2.2.4 传递整型数组
查看>>
回馈制动在变频器中的应用
查看>>
Hitech 公司完全免费的学习版 PICC-Lite 编译器套件
查看>>
Android风格与主题
查看>>
android screenOrientation属性
查看>>