Score:-1

Trying to launch an app via shell_exec on php

br flag

I've been scratching my head for days over this problem. I'm fairly decent with Linux, but certainly no pro with it.

Goal: Launch soulseek-cli app via shell_exec (www-data user)

The problem isn't getting the PHP side of things working, but it is getting soulseek to launch using the www-data user (or any other user other than techno)

I installed using npm as per the following instructions

npm install -g soulseek-cli (after some keyring commands which I'm not sure about)

https://github.com/aeyoll/soulseek-cli

I can get soulseek to run as the techno user on the terminal, but I receive the error /usr/bin/env: 'node': No such file or directory when trying to launch soulseek via www-data on the PHP page.

On the terminal trying to launch soulseek via root gives command not found even though it can be found with whereis soulseek

It appears the application is installed only for techno? Is there any way to use the techno user instead of www-data on php? or any way of www-data running the user techno apps?

Shell script:

shell script

PHP script:

PHP script

Trying to run soulseek as root:

Trying to run soulseek as root

nvm and node versions:

nvm and node versions

Score:0
ro flag

The User www-data simply do not have the right too run this program without to enter a password.

You can edit the file /etc/sudoers to make this possible.

Look for the entrys in your sudoers-file and add the specific path of your application. Possibly "/usr/bin/soulseek" ?

I did this to controll my webcam and execute a script over a php-page of my website which writes the temperature/humidity-Data in a file. I called the collection of all filepath simply "Camera-Funktions = CAMFKT".

# Cmnd alias specification
Cmnd_Alias CAMFKT = /usr/bin/cam_on, /usr/bin/cam_off, /usr/bin/cam_reset, /usr/bin/play, /usr/bin/HTU21D.

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

www-data   ALL=(ALL) NOPASSWD: CAMFKT

I did not changed the root and %sudo entry, this is only there to show you the location, where you have to place the other entrys in the file. You know how to edit the sudoers file? If you changed it, the user www-data (someone from the internet) can execute the program. Be carefully.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.