'Add a user to the remote system.
name - the username of the user being added
uid - optional user id to use when creating new user
gid - optional group id to use when creating new user
shell - optional shell assign to new user (default: bash)'

def add_user(self, name, uid=None, gid=None, shell='bash'):

    if gid:
        self.ssh.execute(('groupadd    -o    -g    %s    %s' % (gid, name)))
    user_add_cmd = 'useradd    -o    '
    if uid:
        user_add_cmd += ('-u    %s    ' % uid)
    if gid:
        user_add_cmd += ('-g    %s    ' % gid)
    if shell:
        user_add_cmd += ('-s    `which    %s`    ' % shell)
    user_add_cmd += ('-m    %s' % name)
    self.ssh.execute(user_add_cmd)
