0

On my macos i am able to login to sftp as sftp localhost. When i run !pwd it shows me default directory is /Users/username but i want to change it /Users/username/Sites/wordpress.

I edited /etc/ssh/sshd_config file & added below lines at bottom of file

Match User username
       X11Forwarding no
       AllowTcpForwarding yes
       PermitTTY yes
       PasswordAuthentication yes
       ChrootDirectory /Users/username/Sites/wordpress

But when i again try to login with sftp localhost after password prompt it gives me error as below

client_loop: send disconnect: Broken pipe
Connection closed 

Please tell me how can fix this error ?

EDIT:

Subsystem sftp internal-sftpr

# Example of overriding settings on a per-user basis
Match User username
    X11Forwarding no
    AllowTcpForwarding yes
    PermitTTY yes
    PasswordAuthentication yes
        ChrootDirectory /Users/username/Sites/wordpress

1 Answer 1

0

You should configure sshd to use internal-sftp for SFTP, not the old external sftp-server binary.

Subsystem sftp internal-sftp

The internal-sftp can use a chroot directory without requiring any supporting files to be placed in that directory.

You may also read about all the other differences between internal-sftp and the old sftp-server.

7
  • This did not work for me.
    – TechChain
    Jul 6, 2020 at 14:08
  • @TechChain What did not work for you? What happened? Jul 6, 2020 at 15:18
  • client_loop: send disconnect: Broken pipe Connection closed i get this error & i have edited my question
    – TechChain
    Jul 6, 2020 at 16:43
  • Check your logs. Jul 6, 2020 at 16:47
  • Where i can check logs?
    – TechChain
    Jul 6, 2020 at 16:47

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.