diff --git a/examples/sshd.py b/examples/sshd.py
index 2bedb9cb0679d54d941ac7a845b05ffa35e6c5df..3c94359b4e020b87cae3af40ed6e7dbc4cfb699a 100755
--- a/examples/sshd.py
+++ b/examples/sshd.py
@@ -16,6 +16,8 @@
 - running server processes (sshd in this case) on hosts
 """
 
+import sys
+
 from mininet.net import Mininet
 from mininet.cli import CLI
 from mininet.log import lg
@@ -68,4 +70,6 @@ def sshd( network, cmd='/usr/sbin/sshd', opts='-D' ):
 if __name__ == '__main__':
     lg.setLogLevel( 'info')
     net = TreeNet( depth=1, fanout=4, switch=OVSKernelSwitch )
-    sshd( net )
+    # get sshd args from the command line; default: -D
+    opts = ' '.join( sys.argv[ 1: ] ) if len( sys.argv ) > 1 else '-D'
+    sshd( net, opts=opts )