概述
[root@b ~]# rpm -qa | grep telnet
telnet-0.17-64.el7.x86_64
telnet-server-0.17-64.el7.x86_64
[root@b ~]# chkconfig --list | grep telnet
注:该输出结果只显示 SysV 服务,并不包含
原生 systemd 服务。SysV 配置数据
可能被原生 systemd 配置覆盖。
要列出 systemd 服务,请执行 'systemctl list-unit-files'。
查看在具体 target 启用的服务请执行
'systemctl list-dependencies [target]'。
[root@b ~]# systemctl list-unit
list-unit-files list-units
[root@b ~]# systemctl list-unit-files | grep telnet
telnet@.service static
telnet.socket disabled
[root@b ~]# systemctl start retelnet.socket
Failed to start retelnet.socket: Unit not found.
[root@b ~]# systemctl restart telnet.socket
[root@b ~]# systemctl enable telnet.socket
Created symlink from /etc/systemd/system/sockets.target.wants/telnet.socket to /usr/lib/systemd/system/telnet.socket.
[root@b ~]# systemctl list-unit-files | grep telnet
telnet@.service static
telnet.socket enabled
[root@b ~]# chkconfig telnet.socket on
服务 telnet.socket 信息读取出错:没有那个文件或目录
[root@b ~]# chkconfig sshd on #centos 7不在支持chkconfig方式设置开机自启动
注意:正在将请求转发到“systemctl enable sshd.service”。
[root@b ~]# firewall-cmd --list-services #查看当前开启了哪些端口
dhcpv6-client ssh telnet
[root@b ~]# firewall-cmd --get-services #查看还可以开启哪些服务
RH-Satellite-6 amanda-client amanda-k5-client bacula bacula-client bgp bitcoin b
itcoin-rpc bitcoin-testnet bitcoin-testnet-rpc ceph ceph-mon cfengine condor-col
lector ctdb dhcp dhcpv6 dhcpv6-client dns docker-registry docker-swarm dropbox-l
ansync elasticsearch freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trus
t ftp ganglia-client ganglia-master git gre high-availability http https imap im
aps ipp ipp-client ipsec irc ircs iscsi-target jenkins kadmin kerberos kibana kl
ogin kpasswd kprop kshell ldap ldaps libvirt libvirt-tls managesieve mdns minidl
na mongodb mosh mountd ms-wbt mssql murmur mysql nfs nfs3 nmea-0183 nrpe ntp ope
nvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole pmcd pmproxy pmwebapi pm
webapis pop3 pop3s postgresql privoxy proxy-dhcp ptp pulseaudio puppetmaster qua
ssel radius redis rpc-bind rsh rsyncd samba samba-client sane sip sips smtp smtp
-submission smtps snmp snmptrap spideroak-lansync squid ssh syncthing syncthing-
gui synergy syslog syslog-tls telnet tftp tftp-client tinc tor-socks transmissio
n-client upnp-client vdsm vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local
xmpp-server zabbix-agent zabbix-server
[root@b ~]# firewall-cmd --add-service=telnet #添加需要通过防火墙的服务
Warning: ALREADY_ENABLED: 'telnet' already in 'public'
success
[root@b ~]# firewall-cmd --permanent --add-service=telnet #永久开放一个服务,加上permanent,开启自动放行
Warning: ALREADY_ENABLED: telnet
success
[root@b ~]# firewall-cmd --reload #更新防火墙规则
success
windows客户端cmd验证:
服务器重启后,客户端验证正常。
转载于:https://www.cnblogs.com/xiaofeng666/p/10900873.html
最后
以上就是柔弱水池为你收集整理的centos 7 安装Telnet并设为开机自启动、开防火墙端口的全部内容,希望文章能够帮你解决centos 7 安装Telnet并设为开机自启动、开防火墙端口所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复