title: iptables Bad argument `ACCEPT' in a Bash function
body: <p><strong>I am trying to create a bash function that will whitelist a IP on a remote VPS:</strong></p>
  
  <pre><code>function whitelist-ip () { ssh vps-01 '/usr/bin/sudo /sbin/iptables -v -I INPUT 1 -s $1 -j ACCEPT'; }
  </code></pre>
  
  <blockquote>
    <p>[jdorfman@mba.local]:~$ whitelist-ip 192.0.43.10</p>
    
    <p>Bad argument 'ACCEPT'</p>
    
    <p>Try iptables -h' or 'iptables --help' for more information.'</p>
  </blockquote>
  
  <p><strong>It works in the CLI:</strong></p>
  
  <blockquote>
    <p>[jdorfman@mba.local]:~$ ssh vps-01 '/usr/bin/sudo /sbin/iptables -v -I INPUT 1 -s 192.0.43.10 -j ACCEPT'</p>
    
    <p>ACCEPT  all opt -- in * out *  192.0.43.10  -> 0.0.0.0/0</p>
  </blockquote>