1、查看端口被佔用
- lsof -i:端口號
- netstat -tunlp|grep 端口號
- netstat -anp|grep 端口號
2、清屏
- ctrl+l
3、添加用戶設置密碼
- useradd testuser 創建用戶testuser
- passwd testuser 給已創建的用戶testuser設置密碼
4、端口轉發【本機端口轉發】
如果只需要在本機間不同的端口轉發就比較容易了,比如 訪問 http://ip:729 我想返回 http://ip:80 的內容,配置如下:
- [root@localhost sbin]# iptables -t nat -A PREROUTING -p tcp --dport 729 -j REDIRECT --to-ports 80
- [root@localhost sbin]# service iptables save
- [root@localhost sbin]# service iptables restart
或者root用戶 vi /etc/sysconfig/iptables
service iptables save
service iptables restart