为什么我总遇上这种奇怪的事情——etc下的设置文件貌似都失灵了?
时间:2007-08-07
来源:互联网
首先,我没法上网,虽然我能ping到网关,网关也能ping到我(显然内网没问题),也在/etc/resolv.conf里设置好了dns,但稀奇的是就是ping不通外网,却可以ping网关(没有任何防护墙阻挡,网络是我做的我很清楚),而在安装前用系统自己net-setup设置的dns都能正常上网更新……
然后发现第二件事情,就是用ssh远程登录的时候,当输入了用户名root后,要等半天才出输入密码的框,而以前用cd启动时ssh速度飞快。
然后发现第三件事情,启动时,命令行里有个黄色的*提示
Your TIMEZONE in /etc/conf.d/clock is still set to Factory!
===============
发现问题,上网查找,第一个问题,我在屡次输入域名服务器无效后,想到一个办法,把在光盘启动时能访问网络的/etc/resolv.conf文件给拷贝到我的目录下,结果,仍然不行,现把我的resolv文件的内容贴出,请大家看有没有写错
GNU nano 2.0.2 File: /etc/resolv.conf nameserver 202.103.24.68 nameserver 202.103.44.150
GNU nano 2.0.2 File: /etc/ssh/sshd_config # $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin # The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options change a # default value. #Port 22 Protocol 2 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: # HostKey for protocol version 1 #HostKey /etc/ssh/ssh_host_key # HostKeys for protocol version 2 #HostKey /etc/ssh/ssh_host_rsa_key #HostKey /etc/ssh/ssh_host_dsa_key # Lifetime and size of ephemeral version 1 server key #KeyRegenerationInterval 1h #ServerKeyBits 768 # Logging # obsoletes QuietMode and FascistLogging #SyslogFacility AUTH #LogLevel INFO # Authentication: #LoginGraceTime 2m #PermitRootLogin yes #StrictModes yes #MaxAuthTries 6 #RSAAuthentication yes #PubkeyAuthentication yes #AuthorizedKeysFile .ssh/authorized_keys # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #RhostsRSAAuthentication no # similar for protocol version 2 #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # RhostsRSAAuthentication and HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes # To disable tunneled clear text passwords, change to no here! PasswordAuthentication no #PermitEmptyPasswords no # Change to no to disable s/key passwords #ChallengeResponseAuthentication yes # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. UsePAM yes #AllowTcpForwarding yes #GatewayPorts no #X11Forwarding no #X11DisplayOffset 10 #X11UseLocalhost yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yes #UseLogin no #UsePrivilegeSeparation yes #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 #UseDNS no #PidFile /var/run/sshd.pid #MaxStartups 10 #PermitTunnel no # no default banner path #Banner /some/path # override default of no subsystems Subsystem sftp /usr/lib/misc/sftp-server # Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # ForceCommand cvs server
GNU nano 2.0.2 File: /etc/conf.d/clock # /etc/conf.d/clock # Set CLOCK to "UTC" if your system clock is set to UTC (also known as # Greenwich Mean Time). If your clock is set to the local time, then # set CLOCK to "local". Note that if you dual boot with Windows, then # you should set it to "local". CLOCK="local" # Select the proper timezone. For valid values, peek inside of the # /usr/share/zoneinfo/ directory. For example, some common values are # "America/New_York" or "EST5EDT" or "Europe/Berlin". #TIMEZONE="Asia/Shanghai" # If you wish to pass any other arguments to hwclock during bootup, # you may do so here. CLOCK_OPTS="" # If you want to set the Hardware Clock to the current System Time # during shutdown, then say "yes" here. CLOCK_SYSTOHC="no" ### ALPHA SPECIFIC OPTIONS ### # If your alpha uses the SRM console, set this to "yes". SRM="no" # If your alpha uses the ARC console, set this to "yes". ARC="no"
作者: abcbuzhiming 发布时间: 2007-08-07
#TIMEZONE="Asia/Shanghai"
前面的#号要去掉才能生效。
作者: zxuan 发布时间: 2007-08-07
你是怎么获取的ip?dhcp还是指定?如果是指定的,估计是你的网关地址没设对。
/etc/conf.d/net :
config_eth0=( "192.168.0.2/24" ) #这里设ip
routes_eth0=( "default gw 192.168.0.1" ) #这里设网关
问题2:
#ListenAddress 0.0.0.0
去掉注释,改成你电脑的ip(你没有固定ip?如果没有当然要解析了。)
例:
ListenAddress 192.168.2.1
作者: zhou3345 发布时间: 2007-08-07
作者: zxuan
第三个问题
#TIMEZONE="Asia/Shanghai" 前面的#号要去掉才能生效。 |
作者: zhou3345
问题1:
你是怎么获取的ip?dhcp还是指定?如果是指定的,估计是你的网关地址没设对。 /etc/conf.d/net : config_eth0=( "192.168.0.2/24" ) #这里设ip routes_eth0=( "default gw 192.168.0.1" ) #这里设网关 问题2: #ListenAddress 0.0.0.0 去掉注释,改成你电脑的ip(你没有固定ip?如果没有当然要解析了。) 例: ListenAddress 192.168.2.1 |
我现在唯一不爽的是eth0不知道怎么搞的居然在我机器里是默认启动的,我已经把他从default启动项里删除了,boot项里也没有,他还是能自动启动,我观察了一下eth0是紧跟着lo启动的,而且貌似排在default启动的前面,但是查不到他的启动项在哪里。因为我现在是用eth1连,搞的我每次启动系统后要手动去关eth0
作者: abcbuzhiming 发布时间: 2007-08-07
设定两块网卡的IP也可以正常工作的,但你即然是ppoe拔号,就不要设定getware,DNS设与不设都无所谓的(pppoe的情况下)。
作者: linuxth 发布时间: 2007-08-07
作者: linuxth
rc-update del net_eth0 default
设定两块网卡的IP也可以正常工作的,但你即然是ppoe拔号,就不要设定getware,DNS设与不设都无所谓的(pppoe的情况下)。 |
不是的,我现在还没pppoe拨号,系统还在更新,我现在是两块网卡,机器是都通过公司的宽带路由器+adsl猫上网,你知道的,这种上网方式都是要设置网关和DNS的。但我就发现这种状况下两块网卡一起启动是没法正常工作的,网上也没有任何帖子讲这种情况下的网卡应该怎么设置,总之我今天下午测试了不下20遍,确认在两块网卡都启动的情况下是没法正常工作的,非要stop一块,另外一块就正常了……
另外请教一下大家有没有好的拨号解决方案,这里的帖子我看过,貌似要实现断线自动拨号都很复杂啊……
作者: abcbuzhiming 发布时间: 2007-08-08
当PPPOE断线后,用以下脚本实现自动重拔。
#!/sbin/runscript depend() { need net } start() { ebegin "Starting ADSL" /usr/sbin/adsl-start eend $? "Connection Failed" } stop() { ebegin "Stopping ADSL" /usr/sbin/adsl-stop eend $? "Failed to stop ADSL" } |
mv adsl /etc/init.d chmod a+x /etc/init.d/adsl rc-update add adsl default |
作者: linuxth 发布时间: 2007-08-08
作者: linuxth
现实PPPOE自动重拔功能
当PPPOE断线后,用以下脚本实现自动重拔。 载入开机自动运行脚本。 注:本代码不是我写的。 |
PS:双网卡在机器在内网模式下上网,经过我反复试验,得出一个结论,第一,第一块被启动的卡(默认是eth0)会有阻断第二块eth1的功能的能力,如果第一块卡启动后没被停止的话你把网线插到第二块卡上,eth1将完全不能工作,但是如果你把eth0给stop,让eth1发挥作用,此时,再次启动eth0,这下就变成eth1阻断eth0的功能了,eth0将瘫痪,可能这是一种网络机制也说不定,另外,我发现,一旦你在/etc/init.d里用ln命令把一块卡和net.lo挂上了,就算你把这卡的启动项从default删除,系统仍然能检测到这块卡,这块卡会随着net.lo启动,除非删除init.d里的这块卡的连接……
作者: abcbuzhiming 发布时间: 2007-08-08
config_eth0=( "192.168.0.2/24" )
routes_eth0=( "default gw 192.168.0.1" )
config_eth1=( "192.168.2.1/24" )
这里eth1不要写网关。因为如果戴两块表就不知道正确时间了。
eth0或eth1的定义是由udev来做的,归 /etc/udev/rules.d/70-persistent-net.rules 文件管。自动识别之后想自己调整,去改这个文件。
作者: zhou3345 发布时间: 2007-08-08
如果你非想不使用eth0的话,好像可以config_eth0=( "none" ),具体记不清了,例子里有
作者: helium_sun 发布时间: 2007-08-08
作者: zhou3345
你的这个问题还是因为路由的设置问题,两块网卡也只要一个路由就可以了。例如:
config_eth0=( "192.168.0.2/24" ) routes_eth0=( "default gw 192.168.0.1" ) config_eth1=( "192.168.2.1/24" ) 这里eth1不要写网关。因为如果戴两块表就不知道正确时间了。 eth0或eth1的定义是由udev来做的,归 /etc/udev/rules.d/70-persistent-net.rules 文件管。自动识别之后想自己调整,去改这个文件。 |
default gw 192.168.0.1
我看到的都是
default via 192.168.0.1
是不是有什么区别?
作者: abcbuzhiming 发布时间: 2007-08-08
作者: zhou3345 发布时间: 2007-08-08
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28