Sei sulla pagina 1di 3

[tdias@localhost ~]$ ifconfig

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500


inet 192.168.232.133 netmask 255.255.255.0 broadcast 192.168.232.255
inet6 fe80::9c3e:1d22:95f8:abf5 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:93:d3:59 txqueuelen 1000 (Ethernet)
RX packets 123 bytes 14833 (14.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 177 bytes 15493 (15.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536


inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 64 bytes 5568 (5.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 64 bytes 5568 (5.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500


inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:35:b3:e0 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[tdias@localhost ~]$ sudo -i


[sudo] password for tdias:
[root@localhost ~]# rpm -qa | grep telnet
[root@localhost ~]# telnet-server-0.17.-59.e17.x86_telnet-0.17-59.e17.x86_64
bash: telnet-server-0.17.-59.e17.x86_telnet-0.17-59.e17.x86_64: command not
found...
[root@localhost ~]# yum install telnet-server telnet
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.myfahim.com
* extras: centos.myfahim.com
* updates: centos.myfahim.com
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-64.el7 will be installed
---> Package telnet-server.x86_64 1:0.17-64.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
telnet x86_64 1:0.17-64.el7 base 64 k
telnet-server x86_64 1:0.17-64.el7 base 41 k

Transaction Summary
================================================================================
Install 2 Packages

Total download size: 105 k


Installed size: 168 k
Is this ok [y/d/N]: y
Downloading packages:
(1/2): telnet-0.17-64.el7.x86_64.rpm | 64 kB 00:00
(2/2): telnet-server-0.17-64.el7.x86_64.rpm | 41 kB 00:01
--------------------------------------------------------------------------------
Total 57 kB/s | 105 kB 00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:telnet-server-0.17-64.el7.x86_64 1/2
Installing : 1:telnet-0.17-64.el7.x86_64 2/2
Verifying : 1:telnet-0.17-64.el7.x86_64 1/2
Verifying : 1:telnet-server-0.17-64.el7.x86_64 2/2

Installed:
telnet.x86_64 1:0.17-64.el7 telnet-server.x86_64 1:0.17-64.el7

Complete!
[root@localhost ~]# firewall-cmd --add service=telnet --zone=public
usage: see firewall-cmd man page
firewall-cmd: error: ambiguous option: --add could match --add-rule, --add-module,
--add-masquerade, --add-destination, --add-lockdown-whitelist-context, --add-
lockdown-whitelist-uid, --add-icmp-block-inversion, --add-lockdown-whitelist-user,
--add-service, --add-source, --add-source-port, --add-lockdown-whitelist-command,
--add-rich-rule, --add-protocol, --add-passthrough, --add-icmp-block, --add-
interface, --add-forward-port, --add-entry, --add-chain, --add-port, --add-entries-
from-file
[root@localhost ~]# firewall-cmd --add service=telnet --zone=public --permanent
usage: see firewall-cmd man page
firewall-cmd: error: ambiguous option: --add could match --add-rule, --add-module,
--add-masquerade, --add-destination, --add-lockdown-whitelist-context, --add-
lockdown-whitelist-uid, --add-icmp-block-inversion, --add-lockdown-whitelist-user,
--add-service, --add-source, --add-source-port, --add-lockdown-whitelist-command,
--add-rich-rule, --add-protocol, --add-passthrough, --add-icmp-block, --add-
interface, --add-forward-port, --add-entry, --add-chain, --add-port, --add-entries-
from-file
[root@localhost ~]# semanage port -a -t telnetd_port_t -p tcp
port option is needed for add
[root@localhost ~]# systemctl start telnet.socket
[root@localhost ~]# systemctl status telnet.socket
? telnet.socket - Telnet Server Activation Socket
Loaded: loaded (/usr/lib/systemd/system/telnet.socket; disabled; vendor preset:
disabled)
Active: active (listening) since Wed 2019-06-19 05:10:15 +0530; 14s ago
Docs: man:telnetd(8)
Listen: [::]:23 (Stream)
Accepted: 0; Connected: 0

Jun 19 05:10:15 localhost.localdomain systemd[1]: Listening on Telnet Server ...


Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# telnet tdias
telnet: tdias: Name or service not known
tdias: Unknown host
[root@localhost ~]# telnet root
telnet: root: Name or service not known
root: Unknown host
[root@localhost ~]# telnet thilina dias
telnet: dias: bad port
[root@localhost ~]# telnet thilinadias
Trying 192.168.232.1...
telnet: connect to address 192.168.232.1: Connection timed out
[root@localhost ~]# telnet 192.168.232.133
Trying 192.168.232.133...
Connected to 192.168.232.133.
Escape character is '^]'.

Kernel 3.10.0-957.el7.x86_64 on an x86_64


localhost login: p1assword
Password:

Login incorrect

localhost login: tdias


Password:
Last login: Wed Jun 19 05:01:31 on :0
[tdias@localhost ~]$
telnet> exit
?Invalid command
telnet> \q
Connection closed.
[root@localhost ~]#

Potrebbero piacerti anche