expect script not working as expected
-
I am trying to use an expect script against a pfsense 2.6 vm running on qemu but I am seeing strange behavior when trying to use it.
expect script (for demo purposes)
#!/usr/bin/expect set timeout -1; spawn telnet localhost 4568 send "\n" expect -ex "Enter an option:" send "8\n" expect "option:" send "8\r" expect eof expect "root" send "./pf-init-2.sh\r" expect "/root"
But when it is run, it hangs at the below prompt:
Adding debug output:
-
@mephmanx
Why don't you use SSH?? -
@viragomann can i change the ssh port? i am running this through an ssh session so ssh to localhost 22 logs in to the local system, not the pfsense vm.
-
@mephmanx said in expect script not working as expected:
can i change the ssh port?
https://docs.netgate.com/pfsense/en/latest/config/advanced-admin.html#ssh-port
A search header in our docs when you search "ssh port"
-
@rcoleman-netgate what would be the value in the xml? i dont have access to the gui in this use case.
-
@viragomann it also appears like I have no access to the networks either...only telnet. i havent hooked up the virtual ports to the host...
-
@mephmanx
Can you edit and re-import the config?If so, there is an <ssh> section within <system>.
You can add a port line there:<port></port>
-