Python script using pxssh not connecting when run as cron job



  • Hi all,

    I'm running pfSense 2.0.1-RELEASE

    I have a python script that uses pxssh to connect to a WLAN controller. The scripts runs fine when I run it manually, but when it is run as a cron job, it fails with a permission denied error in the pxssh.connect command:

    This is the command I run in the cron job:
    echo $SHELL > /myfolder/myscript.out 2>&1; /usr/local/bin/python /myfolder/myscript.py -H 192.168.1.5 -U admin -P Mickey01 >> /myfolder/myscript.out 2>&1

    and this is the output I get:
    /bin/sh
    [ - ] Error connecting

    permission denied

    File "/myfolder/myscript.py", line 12, in connect
        s.login(host,user,password,terminal_type='ansi',original_prompt=" #",login_timeout=10,port=None,auto_prompt_reset=False)
      File "/usr/local/lib/python2.6/site-packages/pxssh.py", line 229, in login
        raise ExceptionPxssh ('permission denied')

    Can anybody help me get this script to run on a schedule?


Log in to reply