1

I have specified a home directory for an sftp by setting /etc/ssh/sshd_config file to something like this.

Match User sftp-hello_world
ChrootDirectory /home/sftp-user/sftp-hello_world
ForceCommand internal-sftp -u 002

when I cannot to the sftp using the said user, it shows the relative path and not the full remote working directory.

sftp> pwd
Remote working directory: /

I am not sure what if it is a sftp client problem or a remote server setting problem. What do you think?

I was expecting something like this.

sftp> pwd
Remote working directory: /home/sftp-user/sftp-hello_world/

My environment is a Windows 10 with a subsystem linux Ubuntu 18.04 LTS installed. The server side is an Amazon Linux AMI if it helps.

1

It's the correct behavior. That's what chroot is.

It actually seems that, what you want, is to set the /home/sftp-user/sftp-hello_world as the home directory of the sftp-hello_world user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.