Last active
February 22, 2016 06:58
-
-
Save koheyamada/a37dedfd2a5fc838b1d8 to your computer and use it in GitHub Desktop.
lsofを使ってプロセスが利用しているポートを確認する。 ref: http://qiita.com/kooohei/items/9e3859e3d1d854c3d163
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lsof -c nginx | |
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
nginx 27576 root cwd DIR 202,1 4096 272412 /etc/nginx/conf.d | |
nginx 27576 root rtd DIR 202,1 4096 2 / | |
nginx 27576 root txt REG 202,1 964976 18099 /usr/sbin/nginx | |
nginx 27576 root DEL REG 0,4 3025922 /dev/zero | |
nginx 27576 root mem REG 202,1 22096 272808 /usr/lib64/perl5/vendor_perl/auto/nginx/nginx.so | |
nginx 27576 root mem REG 202,1 62864 3764 /lib64/libnss_files-2.17.so | |
nginx 27576 root mem REG 202,1 10856 6562 /usr/lib64/libXau.so.6.0.0 | |
nginx 27576 root mem REG 202,1 126288 3886 /usr/lib64/libselinux.so.1 | |
nginx 27576 root mem REG 202,1 165264 4092 /lib64/libexpat.so.1.5.2 | |
nginx 27576 root mem REG 202,1 122312 6606 /usr/lib64/libxcb.so.1.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lsof -i:22,80 | |
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
sshd 1440 root 3u IPv4 7378 0t0 TCP *:ssh (LISTEN) | |
sshd 1440 root 4u IPv6 7380 0t0 TCP *:ssh (LISTEN) | |
sshd 27402 root 3u IPv4 3024720 0t0 TCP 10.0.0.229:ssh->s225.HtokyoFL3.vectant.ne.jp:50596 (ESTABLISHED) | |
sshd 27404 ec2-user 3u IPv4 3024720 0t0 TCP 10.0.0.229:ssh->s225.HtokyoFL3.vectant.ne.jp:50596 (ESTABLISHED) | |
nginx 27576 root 10u IPv4 3025923 0t0 TCP *:http (LISTEN) | |
nginx 27578 nginx 10u IPv4 3025923 0t0 TCP *:http (LISTEN) | |
nginx 27578 nginx 15u IPv4 3058872 0t0 TCP 10.0.0.229:http->s225.HtokyoFL3.vectant.ne.jp:54589 (ESTABLISHED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lsof -iTCP:22 | |
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
sshd 1440 root 3u IPv4 7378 0t0 TCP *:ssh (LISTEN) | |
sshd 1440 root 4u IPv6 7380 0t0 TCP *:ssh (LISTEN) | |
sshd 27402 root 3u IPv4 3024720 0t0 TCP 10.0.0.229:ssh->s225.HtokyoFL3.vectant.ne.jp:50596 (ESTABLISHED) | |
sshd 27404 ec2-user 3u IPv4 3024720 0t0 TCP 10.0.0.229:ssh->s225.HtokyoFL3.vectant.ne.jp:50596 (ESTABLISHED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lsof -p 1440 | |
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
sshd 1440 root cwd DIR 202,1 4096 2 / | |
sshd 1440 root rtd DIR 202,1 4096 2 / | |
sshd 1440 root txt REG 202,1 617128 7432 /usr/sbin/sshd | |
sshd 1440 root mem REG 202,1 62864 3764 /lib64/libnss_files-2.17.so | |
sshd 1440 root mem REG 202,1 44224 3776 /lib64/librt-2.17.so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment