读书人

杂学散记(五)配置ARM开发板支持teln

发布时间: 2013-01-23 10:44:50 作者: rapoo

杂学杂记(五)配置ARM开发板支持telnet远程访问

Telnet协议是TCP/IP协议族中的一员,是Internet远程登陆服务的标准协议和主要方式。它为用户提供了在本地计算机上完成远程主机工作的能力。在终端使用者的电脑上使用telnet程序,用它连接到服务器。终端使用者可以在telnet程序中输入命令,这些命令会在服务器上运行,就像直接在服务器的控制台上输入一样。可以在本地就能控制服务器。

telnet服务位于busybox中。

配置busybox Networking Utilities ---> [*] telnetd
[*] Support standalone telnetd (not inetd only)td only) 取消busybox telnet 登录时的密码问题:
Login/Password Management Utilities --->
[ ] login //取消这选择 注意: telnet服务选择好后,编译---重启,telnet成功,但是不能登录,因为总是显示密码不对,其实是因为没有开端口。系统禁止telnet登陆。现在需要更改系统文件:/etc/securetty pts/0 #手动在文件前面加的
console #系统原文第一行
还有需要注意,pts/0表示可以同时开一个telnet端口登录,如果需要多个人同时登录,则需要多添加几个,比如:pts/1、pts/2等等。
选以下参阅友坚技术:1.关于telnet命令的相关信息

[root@urbetter /]# telnet --help

BusyBox v1.13.3 (2009-03-25 15:48:45 CST) multi-call binary

Usage: telnet [-a] [-l USER] HOST [PORT]

Connect to telnet server

Options:

-a Automatic login with $USER variable

-l USER Automatic login as USER

2.开发板telnet登录到其他提供了telnet服务器的主机

---确认开发板的ip地址,确认开发板能连接Internet

ifconfig

ping内网的ip ;ping外网的ip

---设置路由ip:route add default gw 192.168.1.1

---登录:telnet 202.112.7.137

----------------------------------------------

3.开发板设置好网络,登录Internet

---设置网关:route add default gw 192.168.1.1(根据实际情况设定)

---确认连通Internet:ping 202.112.17.137

---设置域名解析服务器:

查看你pc机上的DNS服务器的ip地址 202.96.128.96

vim /etc/resolv.conf 添加 nameserver 202.96.128.96

或者rm /etc/resolv.conf ;touch /etc/resolv.conf;

echo nameserver 202.96.128.96 >> /etc/resolv.conf

-------------------------

4.开发板登录Linux主机

4.1Linux主机安装telnet服务

sudo apt-get install xinetd telnetd

修改配置

  sudo vi /etc/inetd.conf并加入以下一行

telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd

4.2sudo vi /etc/xinetd.conf并加入以下内容:

# Simple configuration file for xinetd

#

# Some defaults, and include /etc/xinetd.d/

defaults

{

# Please note that you need a log_type line to be able to use log_on_success

# and log_on_failure. The default is the following :

# log_type = SYSLOG daemon info

instances = 60

log_type = SYSLOG authpriv

log_on_success = HOST PID

log_on_failure = HOST

cps = 25 30

}

includedir /etc/xinetd.d

----------------------------------------------

---------------------------------------------

4.3sudo vi /etc/xinetd.d/telnet并加入以下内容:

# default: on

# description: The telnet server serves telnet sessions; it uses

# unencrypted username/password pairs for authentication.

service telnet

{

disable = no

flags = REUSE

socket_type = stream

wait = no

user = root

server = /usr/sbin/in.telnetd

log_on_failure += USERID

}

5.重启机器或重启网络服务sudo /etc/init.d/xinetd restart

6.使用TELNET客户端远程登录;

ifconfig -a 显示本机地址。

读书人网 >移动开发

热点推荐