Using QEMU to simulate VEXPRESS-A9 (vii)---Install Telnet service on embedded devices

Source: Internet
Author: User

Reprint: http://blog.csdn.net/liuqz2009/article/details/6921789

The Telnet protocol is one of the easiest ways to log on to a remote network host, but it is very low security. For target board, you must perform a telnet monitor so that you can log on to target board remotely. At the same time, if you want to remotely log in to other hosts via telnet from the Development Board, you need to have telent client.

The tools for Telnet on embedded Linux systems are:
·Telnet Client
BusyBox telnet Client. The busybox itself is tailored to the embedded system, and its Telnet client is streamlined and relatively usable.

·telnet server
    mainly has telnetd and utelnetd. In terms of file size, the binary files produced by the utelnetd suite are smaller than the telnetd, but the utelnetd does not support Internet super-server. Let's look at the Telnet function of BusyBox. The client is simple, the choice can be used, and the telnetd is relatively troublesome.

    telnetd porting no trouble, BusyBox has integrated one. But because of the initial configuration problems, it took some time to be stable.

(1) configuration of the BusyBox

    configuration section for telnetd:

Networking Utilities--->

[*]telnetd
[*]  support standalone telnetd (not inetd only)

    Configuration instructions for this place, telnetd can be started by inetd or standalone.

Configure kernel
unix98_ptys=y

Add
mkdir/dev/pts
mount-t devpts devpts/dev/pts

Red section can also be added in/etc/fstab
devpts/dev/pts devpts defaults 0 0

Span style= "color: #ff12;" > add
manually

let's start by introducing how to add it manually. To add the root user as an example, add the passwd file with the following content:#cat passwdroot:x:0:0:root:/root:/bin/shat the same time, make sure that the root directory already exists. 1 User Name2 If there is an encrypted password, x indicates that there is no fill, no, the use of MD5, DES encryption. 3 User ID4 Group ID5 Comment Fields6 Login Directory7 shell programs used Add the group file with the following content:#cat Grouproot:x:0:1 Group name2 If there is an encrypted password, the same passwd3 Group ID4 array pointing to each user name pointer because BusyBox starts the shadow mode by default, you need to add the shadow file with the following content:#cat Shadowroot:$1$3jz93mwq$oaeef6lwiuthavs8wd0wh1:0:0:99999:7 :::1 User Name2 password After encryption, if empty, indicating that the user does not need a password to log in, if the * number, indicating that the account is disabled. The above represents a 123456 encrypted password. 3 days from January 1, 1970 to password last modified4 password can not be modified by the user within a few days5 Number of days after the password must be modified (0 is not modified)6 Number of days after the password expires user account is forbidden7 The password to warn the user within the expiration of the number of days8 The number of days that the password has been banned since January 1, 19709 Reserved DomainsHere we emphasize the origin of the shadow file. The/etc/passwd file is readable for all users of the system, and the benefit is that each user knows which users are on the system, but the disadvantage is that other users ' passwords are vulnerable, especially if the password is simpler. Therefore, some Linux systems use the shadow password file shadow, the user's password is stored in another file/etc/shadow, the file only root user root readable, greatly improved security.

However, the use of this method of manually adding files has a flaw, that is, if you want to set a login password for the user, the shadow file must fill in the encrypted password, and this encryption algorithm we do not know, even know, to be converted after the addition, more trouble. In this case, try the second method.

Automatically add

Auto-generation uses the AddUser tools and passwd tools provided by BusyBox. after the file system is up and running, use the AddUser command, using the following method:#adduser RootThe passwd, group, and SHADOW3 files are automatically generated in the ETC directory and can be created manually if they are not generated automatically. However, when you run the command, the following message is printed:Passwd:unknown UID 0This means that you cannot set a password for the user, and you will find that you cannot use the passwd command at this time. The workaround is to open the passwd file with the following contents:Root:x:1000:1000:linux user...:/home/root:/bin/shchange both the user ID and the group ID to 0Open the group file with the following contents:root:x:1000:also change the group ID to 0the passwd command can then be used normally. The root user is then set the password:#passwd Root

Enter the password as prompted. The directory after the root user logs on can be changed manually.

Add the following script to the RCS file to start the telnetd

if [-x/usr/sbin/telnetd]; Thentelnetd&fiØ Add a null device file in the/dev directory, or the above script will run with an error: You are prompted not to find a null file. #mknod NULL C 1 3

At this point, the telnetd function will boot up.

Reference URL
http://student.csdn.net/space.php?uid=48851&do=blog&id=11401
Http://linux.chinaunix.net/bbs/archiver/?tid-988432.html

When you execute the telnet command, you can use the "escape" character after connecting to the remote machine to enter the telnet command mode, in which the user can enter commands that Telnet can interpret to control telnet or set parameters related to Telnet. The default "Escape" character is "Ctrl +]". Users can use the SET command to modify the default value of the "escape" character.

Use QEMU to simulate VEXPRESS-A9 (vii)---Install Telnet service on embedded devices

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.