SFTP pwd command option to show full path of the current remote working directory

1

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.

Nassign

Posted 2019-07-08T08:41:21.957

Reputation: 353

Answers

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.

Martin Prikryl

Posted 2019-07-08T08:41:21.957

Reputation: 13 764