-1

I am confronted with a problem, where I have to automate a task to run a script in pfsense shell, but every time I login in remotely in pfsense I am presented with menu to choose from i.e. to enter shell I have to press 8 every time order to get access to shell and run script there. Is there any way to skip that 8 pressing part and get directly the shell to work on or any other way in a shell/bash script that automatically presses 8, and I get shell directly. Screenshots are below:

enter image description here

This is the shell I get when I login remotely, you can clearly see that I have to press 8 for getting into the shell

enter image description here

See that after pressing 8, I got access to shell where I can run actual commands. Any help will be appreciated.

Atif
  • 41
  • 7
  • i have tried giving input in through cat. i will try your suggestion in a moment – Atif Nov 22 '16 at 07:11
  • sorry for late reply but it did not work it prints 8 indefinitely on screen. ssh root@IP address | yes 8 – Atif Nov 22 '16 at 18:06

1 Answers1

2

This only happens when you log as root. Create another user and you'll log directly into shell. Note that pfSense's default shell is tcsh, not bash, but the Bourne shell is available if you run the command sh.

  • Thank You very much kattastroff, but would i be able to have root level privillages. In case i have to run a file to having lists of IPs to block. – Atif Dec 03 '16 at 20:06
  • @Atif I believe you can install `sudo` and follow this [link](https://www.cyberciti.biz/faq/how-to-add-delete-grant-sudo-privileges-to-users-on-freebsd-unix-server/) to let your user sudo without password. – kattastroff Dec 05 '16 at 15:05
  • @Atif let me know if this works so I can edit the answer accordingly ;) – kattastroff Dec 05 '16 at 15:06
  • kattastroff i find a solution .......first make a user in pfsense then by giving (pw user mod myusername -G wheel) will add user to wheel group that is root level privilege group. Check it by (pw groupshow wheel). it will get the job done at least for me and yes it runs the file with IPs. Thanks for your help and interest – Atif Dec 05 '16 at 19:00