2

I´m a real begginer in linux/server/plesk. I had to rent a virtual server Ubunthu to make a test environment.

The company (host) installed automaticaly the Plesk software to help me. I would like to use a user except root via ssh to run some command lines with keys php or composer.

That works with the user root but when I connect by my plesk system user via ssh, any command was found :

bash: npm: command not found

bash: php: command not found

etc...

This user is a system user according to Plesk.

Inside the plesk panel, it´s writing this :

Here you can specify an operating system user for managing files and folders within the webspace by FTP or with File Manager. The system user is also used to access Plesk over SSH (on Linux) or RDP (on Windows) if the corresponding permissions are granted.

If I can access Plesk over SSH, that means I can run command line or just use FTP and File Manager ?

How can I get like a root user all command lines for a plesk user ?

My goal is to get a user which can only run command lines inside the plesk scope ( httpdocs folder ) and do some actions in the plesk panel, specially in the file manager.

I followed this tutorial for php but the php command was not included for my system user.

J.BizMai
  • 2,621
  • 3
  • 25
  • 49

1 Answers1

5

In Plesk only "System user" specified in Web Hosting Access can login to the server via SSH, but this user can not login to Plesk and use File manager.

You need to go to Plesk > Domains > example.com > Web Hosting Access and set Access to the server over SSH to /bin/bash

After that you will be able to login to the server via SSH and execute php commands:

# ssh your_sysuser@ip -bash-4.2$ pwd /var/www/vhosts/example.com -bash-4.2$ php -v PHP 5.4.16 (cli) (built: Apr 12 2018 19:02:01) -bash-4.2$ /opt/plesk/php/7.2/bin/php -v PHP 7.2.8 (cli) (built: Jul 20 2018 12:45:27) ( NTS )

Login to Plesk is only possible for Client, Reseller or an additional created user. You need to create an additional user: Plesk > Subscriptions > example.com > User > Create User Account For more information about Users check documentation

Elvis Plesky
  • 3,190
  • 1
  • 12
  • 21
  • I already gave the Access to the server over SSH to `/bin/bash (chrooted)` and I managed to log in via ssh but my problem is `php -v` is not found – J.BizMai Aug 02 '18 at 20:27
  • Do I need to restart the server after I did this : https://support.plesk.com/hc/en-us/articles/213909545 ? – J.BizMai Aug 02 '18 at 20:31
  • I restarted the server without success. – J.BizMai Aug 02 '18 at 20:46
  • I understood. I have to use `/opt/plesk/php/7.2/bin/php -v` instead of `php -v` which does not work for me. – J.BizMai Aug 02 '18 at 21:11
  • 2
    You need to set /bin/bash , not /bin/bash (chrooted). In chroot it will not work. If you want to use chroot then it's needed to apply https://support.plesk.com/hc/en-us/articles/213909545 for PHP and all other binaries that you want to use – Elvis Plesky Aug 02 '18 at 21:23
  • Ok, actually, I was doing that : add php, composer.phar as it is written in support.plesk.com/hc/en-us/articles/213909545 – J.BizMai Aug 02 '18 at 22:15