debian touch...

    技术2022-05-20  31

     


    修改dibian启动模式为命令行启动

     

    debian 是使用的 System V  init 风格,跟 redhat 不一样。

     

     

     

    在默认安装的情况下,debian runlevel 2,3,4,5 下,均会启动 图形管理器

    gdmkdm

     

    使用 rcconf 命令,取消启动gdmkdm,则 图形界面在 任何 runlevel下均不会

    启动。

     

    如果您只想在 runlevel 5 下启动图形,可以运行下面的命令:(以gdm为例)

     

    #删除原有关于 gdm 的符号链接

    update-rc.d -f gdm remove

     

    #重新设置各runlevel下的符号链接,只在runlevel 5 下启动 gdm

    update-rc.d -f gdm start 99 5 . stop 01 0 1 2 3 4 6 .

     

     

    这样,你就可以在 /etc/inittab 里面指定

    id:5:initdefault:

     

    来启动 X 了。

     


    debian挂载光驱、软驱、usb

    1)挂载光驱:mount -t iso9660 -r /dev/cdrom /media/cdrom2)挂载软驱 mount –t fstype /dev/fd0 /mnt/floppy3)挂载usb硬盘 首先确定是否支持usb设备dmesg |grep usb是提示 usbcore: registered new driver usb-storage 不然, modprobe usb-storage使用命令: fdisk -l 可以找到usb设备sda (如下)/dev/sda1 W95 FAT32 (LBA)于是利用mount -t vfat -o iocharset=gb2312 /dev/sda1 /mnt/usb

     

     

    debian网络配置

     

    以下是在debian etch版本上进行的。IP的配置文件是/etc/network/interfaces打开后添加如下内容auto loiface lo inet loopbackauto eth0iface eth0 inet staticaddress 你的IPnetmask 子网掩码gateway 网关如果IP是动态分配的,就要把后面的改为iface eth0 inet dhcp然后保存文件即可。DNS在/etc/resolv.conf中设置,格式如下namesever xxx.xxx.xxx.xxx好了,修改完毕后,运行/etc/init.d/networking restart使生效。

     

     

     



     

    Debian网络配置 检查网路配置: # ifconfig eth0   配置DHCP客户端: # vim /etc/network/interfaces 加入 iface eth0 inet dhcp   强制重新获取IP # dhclient eth0   配置静态IP地址: # vim /etc/network/interfaces eth0配置如下: auto eth0 iface eth0 inet static address 192.168.10.13 netmask 255.255.255.0 gateway 192.168.10.1   让配置生效: 保存退出后,使用重启network命令让新配置生效: # ./network restart 也可以重启网卡让配置生效,这样不影响其他网络接口: # ifdown eth0  或者 ifconfig eth0 down # ifup eth0    或者  ifconfig eth0 up   临时改变IP地址: # ifconfig eth0 192.168.10.13 netmask 255.255.255.0 up 系统重启后,会恢复interfaces中的配置   设置默认网关的方法: 1、在interfaces文件中设置 2、命令行设置 删除当前缺省网关 # route del defalt gw 手工配置缺省网关 # route add default gw 192.168.10.1 查看路由信息 # route 使用此方法,修改当即生效,重启后,则以interfaces中的配置为准。   查看主机名: # hostname   临时修改主机名: # hostname jerrydebianserver   永久修改主机名: # vim /etc/hostname 写入新的主机名即可,重启后以此为准   配置DNS服务器的地址,最多可以使用3个DNS服务器 # vim /etc/resolv.conf nameserver 192.168.10.1 nameserver 202.xxx.xxx.xxx 对“resolv.conf”的修改是即时生效的,可使用nslookup命令进行DNS服务器查询,已验证配置信息v

     

     


     

     

     

    刚把debian装好的时候,网络配置文件/etc/network/interfaces是这样子的:# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopbacklo是本地回环网络,所有电脑127.0.0.1就是指的它,至于如何上网配置固定ip得我在早一点的blog中曾经很简单的写了几笔如何配置,但是通过最近一段时间的摸索发现那样的配置是很不规范的,现在把该文件的详细配置及其注释写出来,供debian的朋友参考,也供自己备份查询。说明几点:1、主网络接口,我的理解是要么是dhcp(动态获得ip)要么是静态ip模式,所以二者只能配置其一,我现在使用的是dhcp模式,所以把静态ip的设置注释掉了。也许2者可以同时配置,有兴趣的同学不妨试试。2、无线网络接口是要在配置好intel或者windows的驱动后才能起作用的。3、PPPoE是宽带拨号方式,网上说和静态ip模式是一样的,我没有实验条件,所以不写出配置方式,免得误导。4、还有一种是使用56kbps电话线拨号上网的配置,应当也是dhcp模式的,但是非常不好意思的说我也是没有配置出来,因为我的t41内置的modem我一直没能驱动上。这个可以等驱动上以后再写出来。# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# This file is modified by Jackie on Apr 4th, 2008.####LO########### The loopback network interface(配置环回口)# 开机自动激lo接口auto lo# 配置lo接口为环回口iface lo inet loopback#####DHCP########## The primary network interface (配置主网络接口)# 开机自动激活eth0接口 auto eth0 # 配置eth0接口为DHCP自动获取 iface eth0 inet dhcp####Static IP#### The primary network interface (配置主网络接口)# 开机自动激活eth0接口 # auto eth0 # 配置eth0接口为静态设置IP地址 # iface eth0 inet static # address 128.1.1.94# netmask 255.255.255.0# gateway 192.168.109.1#####WLAN##### # The wireless network interface (配置无线网络接口) # 开机自动激活wlan0接口auto wlan0# 配置wlan0接口为DHCP自动获取iface wlan0 inet dhcp####PPPoE#### # The PPPoE network interface (配置宽带接口) #

     


     

     

     

     

     

     

     

     

     

     

     



     



     

     

     

     

     

     


    最新回复(0)