Debainlinuxos install telnetserver

Source: Internet
Author: User
Debainlinuxos: Install telnetserver-Debian Technology for Linux release. For details, refer to the following section. Note: This article discusses telnet server rather than telnet client.

The telnet server of debain linux is mounted on xinet. d. The telnet operation is/etc/init. d/xinet. d force-reload | restart | start | stop.

In this article, both debain (2.6.18-4-686) and ubuntu (2.6.20-15-generic) are tested successfully. The installation steps are as follows (ubuntu is used as an example ):

Install internet superserver: xinetd.
Root @ zhoudh-desktop:/# apt-get install xinetd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
Xinetd
0 upgraded, 1 newly installed, 0 to remove and 166 not upgraded.
Need to get 135kB of archives.
After unpacking into KB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
Xinetd
Install these packages without verification [y/N]? Y
Get: 1 http://cn.archive.ubuntu.com feisty/main xinetd. 3.14-1ubuntu1 [135kB]
Fetched 135kB in 44 s (3009B/s)
Selecting previusly deselected package xinetd.
(Reading database... 90150 files and directories currently installed .)
Unpacking xinetd (from.../xinetd_1% 3a2. 3.14-1ubuntu1_i386.deb )...
Setting up xinetd (2.3.14-1ubuntu1 )...
Stopping internet superserver: xinetd.
Adding 'diversion of/etc/init. d/inetd to/etc/init. d/inetd. real by xinetd'
Starting internet superserver: xinetd.

Install telnet server
Install software
Root @ zhoudh-desktop:/# apt-get install telnetd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
Telnetd
0 upgraded, 1 newly installed, 0 to remove and 166 not upgraded.
Need to get 0B/42.0kB of archives.
After unpacking 147kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
Telnetd
Install these packages without verification [y/N]? Y
Selecting previusly deselected package telnetd.
(Reading database... 90170 files and directories currently installed .)
Unpacking telnetd (from.../telnetd_0.17-35ubuntu1_i386.deb )...
Setting up telnetd (0.17-35ubuntu1 )...

After the installation is complete, the system will add a line of information in/etc/inetd. conf:
Telnet stream tcp nowait telnetd/usr/sbin/tcpd/usr/sbin/in. telnetd
Root @ zhoudh-desktop: // # cat/etc/inetd. conftelnet stream tcp nowait telnetd/usr/sbin/tcpd/usr/sbin/in. telnetd

If this row does not exist, add it.

Modify configuration file
Root @ zhoudh-desktop:/# cd/etc/xinetd. d/
Root @ zhoudh-desktop:/etc/xinetd. d # vi 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

Server_args =-h

Log_on_failure + = USERID


}
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"Telnet" [New File] 29 lines, 435 characters written
Root @ zhoudh-desktop:/etc/xinetd. d #

In the online example, nano-w/etc/xinetd. d/telnet is used to create the telnet configuration file, but vi is actually used.

Install telnet client
Root @ zhoudh-desktop:/# apt-get install telnet
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
Telnet
0 upgraded, 1 newly installed, 0 to remove and 166 not upgraded.
Need to get 0B/65.6kB of archives.
After unpacking 188kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
Telnet
Install these packages without verification [y/N]? Y
Selecting previusly deselected package telnet.
(Reading database... 90182 files and directories currently installed .)
Unpacking telnet (from.../telnet_0.17-35ubuntu1_i386.deb )...
Setting up telnet (0.17-35ubuntu1 )...

Restart the xinetd service
Root @ zhoudh-desktop: // #/etc/init. d/xinetd reload
Reloading internet superserver configuration: xinetd.
Root @ zhoudh-desktop: // #/etc/init. d/xinetd restart
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
Root @ zhoudh-desktop:/# netstat-anp | grep LISTEN
Tcp 0 0 127.0.0.1: 2208 0.0.0.0: * LISTEN 4609/hpiod
Tcp 0 0 0.0.0.0: 2401 0.0.0.0: * LISTEN 20744/xinetd
Tcp 0 0 0.0.0.0: 23 0.0.0.0: * LISTEN 20744/xinetd
Tcp 0 0 127.0.0.1: 631 0.0.0.0: * LISTEN 5566/cupsd
Tcp 0 0 127.0.0.1: 2207 0.0.0.0: * LISTEN 4612/python
Tcp6 0 0: 22: * LISTEN 4772/sshd
For unix 2 [ACC] stream listening 15635 4820/hcid/var/run/sdp
......

0 0.0.0.0: 23 is the telnet server daemon (the default telnet listening port is 23.

Test connection
Obtains the ip address of the local machine.
Root @ zhoudh-desktop:/# ifconfig
Eth0 Link encap: Ethernet HWaddr 00: 0C: 29: CE: B5: 3F
Inet addr: 192.168.200.254 Bcast: 192.168.200.255 Mask: 255.255.255.0
Inet6 addr: fe80: 20c: 29ff: fece: b53f/64 Scope: Link
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 6632 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 5387 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 2339516 (2.2 MiB) TX bytes: 790404 (771.8 KiB)
Interrupt: 18 Base address: 0x1400

Lo Link encap: Local 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: 3402 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 3402 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 143116 (139.7 KiB) TX bytes: 143116 (139.7 KiB)

Use telnet to log on to another host
Zhoudh-desktop login: root

Login incorrect
Zhoudh-desktop login: zhoudh
Password:
Last login: Mon Dec 10 16:43:40 2007 from 192.168.200.250 on pts/2
Linux zhoudh-desktop 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686

The programs encoded with the Ubuntu system are free software;
The exact distribution terms for each program are described in
Individual files in/usr/share/doc/*/copyright.

Ubuntu comes with absolutely no warranty, to the extent permitted
Applicable law.
Zhoudh @ zhoudh-desktop :~ $

We can see from the above that the connection is successful, but the root connection will fail, because the default security setting limits the root user to use telnet to connect to the host.

Allow root Login
Modify configuration file
Root @ zhoudh-desktop :~ # Vi/etc/pam. d/login
Auth requisite pam_securetty.so
-> # Auth requisite pam_securetty.so
The online example uses nano/etc/pam. d/login.
Log On with root
Ubuntu does not provide root users, so this can only be tested on debain.
Localhost login: root
Password:
Last login: Tue Dec 11 06:10:06 2007 from 192.168.200.250 on pts/0
Linux localhost 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686

The programs encoded with the Debian GNU/Linux system are free software;
The exact distribution terms for each program are described in
Individual files in/usr/share/doc/*/copyright.

Debian GNU/Linux comes with absolutely no warranty, to the extent
Permitted by applicable law.
1 failure since last login.
Last was Tue 11 Dec 2007 06:10:37 am est on pts/0.
Localhost :~ #

Of course, it is not recommended to allow root telnet login.

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.