久久精品国产清自在天天线_日韩国产欧美系列_亚洲天堂影视在线观看_91在线艹亚洲无码午夜_日本写真高清视频免费网站网_亚州无码大尺度另类_高跟翘臀老师后进式视频午夜_久久精品国产亚洲AV热黑人_国产另ts另类人妖_丁香五月 开心五月 激情五月

Hi,歡迎來(lái)到嵌入式培訓(xùn)高端品牌 - 華清遠(yuǎn)見(jiàn)教育科技集團(tuán)<北京總部官網(wǎng)>,專注嵌入式工程師培養(yǎng)15年!
當(dāng)前位置: > 華清遠(yuǎn)見(jiàn)教育科技集團(tuán) > 嵌入式學(xué)習(xí) > 講師博文 > 根文件系統(tǒng)中添加telnetd服務(wù)
根文件系統(tǒng)中添加telnetd服務(wù)
時(shí)間:2017-01-03作者:華清遠(yuǎn)見(jiàn)

使用busybox制作的一個(gè)基本根文件系統(tǒng)如何添加telnetd服務(wù)呢?

下面把本人的添加過(guò)程列出來(lái)供大家分享,如有不同意見(jiàn)請(qǐng)不吝賜教!

1、 添加telnet的支持(busybox中配置)

Networking Utilities ---> 
                [*] telnet 
                [*] Pass TERM type to remote host
                [*] Pass USER type to remote host
                [*] telnetd
                [*] Support standalone telnetd (not inetd only)

2、 添加mdev的支持(busybox中配置)

        Linux System Utilities ---> 
                [*] mdev

3、 添加login(busybox中配置)

Login/Password Management Utilities ---> 
        [*] login

4、 修改etc/init.d/rcS添加mdev內(nèi)容

#!/bin/sh

mount -a
        mkdir /dev/pts
        mount -t devpts devpts /dev/pts
        echo /sbin/mdev>/proc/sys/kernel/hotplug
        mdev -s
        /bin/hostname -F /etc/hostname

5、 創(chuàng)建etc/hostnam,并添加主機(jī)名

farsight

6、 在etc下創(chuàng)建文件passwd,group,shadow,創(chuàng)建目錄/home

7、 修改etc/fstab為

#device mount-point type options dump fsck order
        proc /proc proc defaults 0 0
        tmpfs /tmp tmpfs defaults 0 0
        sysfs /sys sysfs defaults 0 0
        tmpfs /dev tmpfs defaults 0 0

8、 內(nèi)核中添加相應(yīng)的支持

UNIX98_PTYS=y
        DEVPTS_FS=y

9、 使用adduser添加用戶

#adduser linux

10、 添加命令行提示符格式,修改/etc/profile添加如下內(nèi)容

PS1='[\u@\h \W]\# '
        HOSTNAME=`/bin/hostname`
        export USER LOGNAME PS1

11、 啟動(dòng)telnet服務(wù),在/etc/profile下添加如下內(nèi)容

telnetd

這個(gè)時(shí)候我們就可以同過(guò)telnet client登陸我們的板子了。上面這些步驟有些不是必須的,大家可以根據(jù)需求選擇。

12、 參考文獻(xiàn)

A daemon for the TELNET protocol, allowing you to log onto the host running the daemon. Please keep in mind that the TELNET protocol sends passwords in plain text. If you can't afford the space for an SSH daemon and you trust your network, you may say 'y' here. As a more secure alternative, you should seriously consider installing the very small Dropbear SSH daemon instead:

//matt.ucc.asn.au/dropbear/dropbear.html 
        Note that for busybox telnetd to work you need several things:
        First of all, your kernel needs:
        UNIX98_PTYS=y
        DEVPTS_FS=y
        Next, you need a /dev/pts directory on your root filesystem:
        $ ls -ld /dev/pts
        drwxr-xr-x 2 root root 0 Sep 23 13:21 /dev/pts/
        Next you need the pseudo terminal master multiplexer /dev/ptmx:
        $ ls -la /dev/ptmx
        crw-rw-rw- 1 root tty 5, 2 Sep 23 13:55 /dev/ptmx
        Any /dev/ttyp[0-9]* files you may have can be removed.
        Next, you need to mount the devpts filesystem on /dev/pts using:
        mount -t devpts devpts /dev/pts
        You need to be sure that Busybox has LOGIN and FEATURE_SUID enabled. And finally, you should make certain that Busybox has been installed setuid root: 
        chown root.root /bin/busybox
        chmod 4755 /bin/busybox with all that done, telnetd _should_ work....

發(fā)表評(píng)論
評(píng)論列表(網(wǎng)友評(píng)論僅供網(wǎng)友表達(dá)個(gè)人看法,并不表明本站同意其觀點(diǎn)或證實(shí)其描述)