LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 941|回复: 7

telnet使用命令问题

[复制链接]
发表于 2008-2-14 11:49:53 | 显示全部楼层 |阅读模式
请问一个问题, 在linux下启动TELNET服务.当用windows的CMD模式下 ,连接TELNET linux主机,为何使用不了/sbin 下的命令 例如: ifconfig
大虾们指教一下 谢谢
发表于 2008-2-14 11:55:12 | 显示全部楼层
echo $PATH
看看 /sbin 是否在 PATH 里面
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-2-14 17:17:15 | 显示全部楼层
有啊!~SSH连接就没有问题喔

/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
回复 支持 反对

使用道具 举报

发表于 2008-2-15 08:55:09 | 显示全部楼层
看看下面的命令什么结果
type ifconfig
ls -l /sbin/ifconfig
/sbin/ifconfig
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-2-15 11:13:33 | 显示全部楼层
#type ifconfig
ifconfig is /sbin/ifconfig
#ls -l /sbin/ifconfig
-rwxr-xr-x  1 root root 56204 Sep 30  2004 /sbin/ifconfig
#/sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:CF:8D:94  
          inet addr:192.168.9.250  Bcast:192.168.9.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fecf:8d94/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40534 errors:0 dropped:0 overruns:0 frame:0
          TX packets:671 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:42845051 (40.8 MiB)  TX bytes:103855 (101.4 KiB)
          Interrupt:10 Base address:0x1400

lo        Link encapocal Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:760 (760.0 b)  TX bytes:760 (760.0 b)
回复 支持 反对

使用道具 举报

发表于 2008-2-15 12:04:19 | 显示全部楼层
从以上二次测试来看, ifconfig 确实在 /sbin 目录下, /sbin 也确实在 PATH 中, 怎么会找不到呢? 不过如果真的找不到可以试试把 /sbin 在 PATH 中的位置提前一些试试. 如果还是不行就只有用绝对路径执行命令了
回复 支持 反对

使用道具 举报

发表于 2008-2-15 12:05:32 | 显示全部楼层
直接ifconfig给什么提示?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-2-15 17:47:16 | 显示全部楼层
绝对路径就可以
直接用ifconfig就提示如下信息
bash:ifconfig:command not found
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表