Skip to content
Snippets Groups Projects
Commit 39058432 authored by Brian O'Connor's avatar Brian O'Connor
Browse files

accept command line args in baresshd.py

parent 501a164e
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
"This example doesn't use OpenFlow, but attempts to run sshd in a namespace."
import sys
from mininet.node import Host
from mininet.util import ensureRoot
......@@ -27,6 +28,10 @@
f.close()
print "*** Running sshd"
h1.cmd( '/usr/sbin/sshd -o "Banner /tmp/%s.banner"' % h1.name )
cmd = '/usr/sbin/sshd -o "Banner /tmp/%s.banner"' % h1.name
# add arguments from the command line
if len( sys.argv ) > 1:
cmd += ' ' + ' '.join( sys.argv[ 1: ] )
h1.cmd( cmd )
print "*** You may now ssh into", h1.name, "at", h1.IP()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment