sftp icon indicating copy to clipboard operation
sftp copied to clipboard

Specify a default directory upon login

Open Daxcor69 opened this issue 3 years ago • 2 comments

I am loving this image. All is working well. I am using this in a K8s env. I have a pvc that I mount in the pod via:

          volumeMounts:
            - mountPath: /home/brad/foundrydata
              name: foundry-data

Then I pass the following to sftp:

args: ["brad:brad:2000:2000:foundrydata"]

When the user logs in the initial dir is "/" showing a sub dir as "foundrydata".

Is there a way to set the default dir for this user upon login? I would want them in /foundrydata/

Thanks Brad

Daxcor69 avatar Apr 21 '22 23:04 Daxcor69

I had the same problem

You'll need to set up your own Dockerfile

FROM atmoz/sftp:alpine

COPY sshd_config /etc/ssh/sshd_config

add this to the /etc/ssh/sshd_config file:

ForceCommand internal-sftp -d /foundrydata

samuelpecher avatar Oct 05 '22 20:10 samuelpecher