FTP / SFTP
How to use goshs as FTP or SFTP server
goshs can serve files over FTP or SFTP using the -ftp flag. By default -ftp activates a plain FTP server on port 2121. Adding -ftp-sftp switches to SFTP mode instead.
Plain FTP
Connect with any standard FTP client:
SFTP
Adding -ftp-sftp switches the same entry point to an SSH-based SFTP server. Authentication is required in SFTP mode — either username/password with -b user:pass or an authorized keys file with -fkf <file-path>. Both options can be used together.
Info
The embedded SSH server generates a fresh host key on every start, which will produce a host key mismatch warning when reconnecting. Generate a permanent host key with ssh-keygen -f ./goshs_rsa_key -N "" -t rsa and supply it via -fhk goshs_rsa_key to avoid this.
The SFTP server also respects -ro (read-only), -uo (upload-only), and the web root set with -d.
Connect with any standard SFTP client: