pufferpanel / pufferpanel

PufferPanel is an open source game server management panel, designed for both small networks and personal use
https://pufferpanel.com
Apache License 2.0
1.24k stars 213 forks source link

SFTP username contains invalid characters #1305

Closed erentar closed 3 months ago

erentar commented 4 months ago

Describe the bug using the sftp command which comes with openssh packets on linux distributions, one cannot connect to upload files to a server instance because of the pipe character present in the username

To Reproduce Steps to reproduce the behavior:

  1. Go to Servers > pick any server > files > SFTP information
  2. Use SFTP information to connect using sftp command sftp -P 5657 asdf@qwerty.com|deadbeef@1.2.3.4.5
  3. See error remote username contains invalid characters.

Desktop (please complete the following information):

LordRalex commented 4 months ago

SFTP does not explicitly ban or have a forced set of characters that can be used. While generally SFTP ends up using local accounts, which has a small subset of rules, this is not an actual requirement that SFTP needs to follow.

SFTP gets around this (and is recommended) by using single quotes around the username.

So, in your command, this is the valid way of doing it: sftp -P 5657 'asdf@qwerty.com|deadbeef'@127.0.0.1

erentar commented 4 months ago

I had tried that, and it did not work.

LordRalex commented 4 months ago

image

What version of SFTP do you have for the client?

erentar commented 4 months ago

OpenSSH_9.3p1, OpenSSL 3.1.1 30 May 2023

LordRalex commented 4 months ago

Either openssh changed, or something's odd with my packages.

I used: OpenSSH_8.2p1 Ubuntu-4ubuntu0.11, OpenSSL 1.1.1f 31 Mar 2020

I tested on my remote machine with this one, it fails: OpenSSH_8.9p1 Ubuntu-3ubuntu0.6, OpenSSL 3.0.2 15 Mar 2022

Sigh......................

LordRalex commented 4 months ago

As a note, I was using WSL as well, which is interesting.

What is the output of cat /etc/lsb-release

LordRalex commented 4 months ago

We've confirmed openssh has in fact made this a breaking change basically.

We are going to end up changing the character. Not my first plan, but looks like one that's going to be needed.

We'll end up probably using #, but this will be a v3 thing. V2 is not going to be getting this change because it's a breaking change.

erentar commented 4 months ago
$ cat /etc/os-release

NAME="Fedora Linux"
VERSION="39 (Container Image)"
ID=fedora
VERSION_ID=39
VERSION_CODENAME=""
PLATFORM_ID="platform:f39"
PRETTY_NAME="Fedora Linux 39 (Container Image)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:39"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f39/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=39
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=39
SUPPORT_END=2024-11-12
VARIANT="Container Image"
VARIANT_ID=container
erentar commented 4 months ago

Thank you for your attention

LordRalex commented 3 months ago

This is resolved in v3, but cannot be done on v2 without it being a breaking change.