pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.81k stars 1.74k forks source link

SFTP issue - wrong credentials in the panel for servers created with the api #1782

Closed HostRK1 closed 4 years ago

HostRK1 commented 4 years ago

Hello,

When I create servers with the api my users can't login to their sftp's (via filezila/winscp etc, not browser file manager). They use their data shown in the panel (host, port, username) and assume that the password is the same as panel password. I also tested this, those details don't seem to work. The only sftp details that work are for servers created directly from the panel (the admin user), those details work (I've created a test server to test it). Basicaly when you create servers with the api, the username shown in the sftp details is name-of-admin-user.server-id instead of name-of-the-user.server-id. Example: admin user: admin User: user Server id: 78snshfjs

Normal (right) SFTP username: user.78snshfjs Displayed (wrong) SFTP username (in the panel): admin.78snshfjs

alhassanv commented 4 years ago

Have you asked on the discord?

HostRK1 commented 4 years ago

I've edited my issue, it apears that only servers created via the api (e.g. whmcs) have this issue, the sftp username is shown wrongly for them (example on my first comment).

DaneEveritt commented 4 years ago

Which API endpoint are you using that is returning incorrect SFTP details?

The username displayed within the panel is determined by the authenticated user, not who owns the server.

https://github.com/pterodactyl/panel/blob/88c5bb4f97b94e6f5689825b3f2428798d6f9a3d/resources/themes/pterodactyl/server/settings/sftp.blade.php#L37-L40

HostRK1 commented 4 years ago

I am using the api endpoint from the whmcs module (that whmcs module provided by Trixter: https://github.com/pterodactyl/whmcs). So do I need to change the sftp.blade.php file and put owner()->user() ? Or I should open an issue on the whmcs module github

Which API endpoint are you using that is returning incorrect SFTP details?

The username displayed within the panel is determined by the authenticated user, not who owns the server.

https://github.com/pterodactyl/panel/blob/88c5bb4f97b94e6f5689825b3f2428798d6f9a3d/resources/themes/pterodactyl/server/settings/sftp.blade.php#L37-L40

DaneEveritt commented 4 years ago

cc @TrixterTheTux

Not sure I follow what your issue is here. I've never heard of anyone else having problems like this. Changing the template is not the way to fix anything.

TrixterTheTux commented 4 years ago

The WHMCS module doesn't do anything special compared to creating the server in the web UI other than set the external_id. I've also haven't had any reports related to this (and seems to work fine on my end).

Are you possibly using the whmcs service password for SFTP (which is ignored and replaced with user configuring their own account's password through a link they receive in their email)? Have you done any modifications to the panel (e.g. custom themes, addons or features)?

arcdigital commented 4 years ago

This doesn't seem to be a bug, closing since there's no activity.