在使用网络程序时先要关掉Linux防火墙,否则可能会链接失败。
1) 永久性生效,重启后不会复原
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后复原
开启: service iptables start
关闭: service iptables stop
3) 查看防火墙状态
chkconfig iptables –list
ssh分私钥和公钥,在访问公司服务器时需要给公钥获取相应的访问权限。获取ssh公钥的脚本是:
jinweilu@JINWEILU MINGW64 /d/lujinwei
$ cd ~/.ssh
jinweilu@JINWEILU MINGW64 ~/.ssh
$ ls
id_rsa id_rsa.pub known_hosts
jinweilu@JINWEILU MINGW64 ~/.ssh
$ cat id_rsa.pub
以上查看到的就是ssh公钥
netstat -ntlp | grep 19812:查看某个进程端口号
查询linux服务器有哪些IP在连接
netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n