Jump to content

This topic is 699 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

I'm running bBox_Shell commands (from Beezwax plug-in https://www.beezwax.net/products/bbox/wiki/main) which is running on a FileMaker Server 17 (with Perform Script on Server). bBox_Shell itself runs fine, but whenever I try to do a sudo to another user, bBox_shell returns a question mark "?" instead of the expected result (see examples below). The exact same shell commands run perfectly fine in an interactive shell.

In order for sudo to work for the fmserver user, I added the following to the sudoers file:
Defaults:fmserver targetpw, timestamp_timeout=0, passwd_tries=1
Host_Alias FMSHOST = mms.local
fmserver    ALL = (ALL) ALL
fmserver FMSHOST = (ALL) /Library/FileMaker\ Server/*, /bin/kill

As I said, in an interactive shell everything works fine:

mac:~ admin$ whoami
admin
mac:~ admin$ echo -n "password" | sudo -S -u fmserver -s whoami
fmserver
mac:~ admin$ sudo -su fmserver
bash-3.2$ whoami
fmserver
bash-3.2$ sudo -u admin -s whoami
admin
bash-3.2$ whoami
fmserver
bash-3.2$ echo -n "password" | sudo -S -u admin -s whoami
admin
bash-3.2$ echo -n "password" | sudo -S -u admin -s ssh [email protected] "mysql -uroot -ppassword -e 'USE mydb; SHOW TABLES;'"
Tables_in_mydb
...


When I issue the exact same commands using bBox (on FMS using Perform Script on Server), I get the following results:
bBox_Shell ( 0 ; "whoami")
fmserver
bBox_Shell ( 0 ; "echo -n \"password\" | sudo -S -u admin -s whoami")
?

Why does bBox differ from the interactive shell? What am I missing? Thanks a lot for any insight!

 

Link to comment
Share on other sites

  • 2 months later...

@gczychi, did you ever sort this out? I'm having the exact same issue with BaseElements BE_ExecuteSystemCommand. I've tried every permutation, been at it so many hours I'm starting to wonder whoiam.

Aside from the "?",I have been able to get BE_ExecuteSystemCommand to respond with...

Password:Sorry, try again.
Password:
sudo: no password was provided
sudo: 1 incorrect password attempt

...it doesn't seem to be actually echoing the password, I think its just pushing the whole command into the password prompt.

Link to comment
Share on other sites

This topic is 699 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.