1
我想創建一個bash的功能,將白名單上的遠程VPS一個IP:是iptables在bash函數錯誤的參數`接受」
function whitelist-ip() { ssh vps-01 '/usr/bin/sudo /sbin/iptables -v -I INPUT 1 -s $1 -j ACCEPT'; }
[[email protected]]: 〜$白名單,IP 192.0.43.10
錯誤的參數 '接受'
嘗試的iptables -h '或 '--help iptables的' 以獲取更多信息。'
它工作在CLI:
[[email protected]]:〜$ SSH VPS-01「的/ usr /斌/須藤/ sbin目錄/ iptables的-v -I INPUT 1 -s 192.0.43.10 -j ACCEPT」
接受所有的選擇 - 在*出* 192.0.43.10 - > 0.0.0.0/0
我愛你和這個網站!非常感謝。 =) – jdorfman 2012-07-10 18:18:55