[root@deyu ~]# lsof -i -n -P | grep LISTEN rpcbind *:111 (LISTEN) named 127.0.0.1:53 (LISTEN) named 127.0.0.1:953 (LISTEN) cupsd 127.0.0.1:631 (LISTEN) sshd *:22 (LISTEN) vsftpd *:21 (LISTEN) dnsmasq 192.168.122.1:53 (LISTEN) qemu-kvm 127.0.0.1:5900 (LISTEN) httpd *:80 (LISTEN) [root@deyu ~]# cat /etc/services | grep '\ 22/tcp' ssh 22/tcp # The Secure Shell (SSH) Protocol
[root@deyu ~]# /etc/init.d/sshd
Usage: /etc/init.d/sshd {start|stop|restart|reload|force-reload|condrestart|try-restart|status}
[root@deyu ~]# /etc/init.d/sshd status
openssh-daemon (pid 2062) is running...
[root@deyu ~]# /etc/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
[root@deyu ~]# service sshd
Usage: /etc/init.d/sshd {start|stop|restart|reload|force-reload|condrestart|try-restart|status}
[root@deyu ~]# /etc/init.d/sshd
[root@deyu ~]# service sshd stop
Stopping sshd: [ OK ]
[root@deyu ~]# service sshd status
openssh-daemon is stopped
[root@deyu ~]# service sshd start
Starting sshd: [ OK ]
[root@deyu ~]# grep -i 'disable' /etc/xinetd.d/*
/etc/xinetd.d/echo-dgram: disable = yes
/etc/xinetd.d/echo-stream: disable = yes
/etc/xinetd.d/rsync: disable = yes
/etc/xinetd.d/tcpmux-server: disable = yes
/etc/xinetd.d/tftp: disable = yes
[root@deyu ~]# grep '^tftp' /etc/services
tftp 69/tcp
tftp 69/udp
tftp-mcast 1758/tcp
tftp-mcast 1758/udp
tftps 3713/tcp # TFTP over TLS
tftps 3713/udp # TFTP over TLS
[root@deyu ~]# netstat -tlun | grep :69
[root@deyu ~]# vi /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/ftp/pub/usb/isolinux
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
[root@deyu ~]# /etc/init.d/xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[root@deyu ~]# netstat -tlun | grep :69
udp 0 0 0.0.0.0:69 0.0.0.0:*
[root@deyu ~]# service --status-all | grep xinetd xinetd (pid 4149) is running...
[root@deyu ~]# netstat -tlun Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 *:ftp *:* LISTEN 2081/vsftpd tcp 0 0 deyu.wang:domain *:* LISTEN 1785/named udp 0 0 deyu.wang:domain *:* 1785/named [root@deyu ~]# netstat -tlunp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2081/vsftpd tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1785/named udp 0 0 127.0.0.1:53 0.0.0.0:* 1785/named
2015-04-13