Iam trying to ssh from macOS into Kali Linux. Both devices are on the same subnet, connected by a home router.

I initiated the ssh service on the device running Kali and set up /etc/ssh/sshd_config to use a password on login. (I set PasswordAuthentication yes and ChrootDirectory /home/remote in /etc/ssh/sshd_config)

Running the following command on the Mac ssh [email protected] logs me in and disconnects after issuing the following error /bin/bash No such file or directory

I can confirm that /bin/bash does exist’s and is listed in /etc/shells.

Error logs from /var/log/auth.log points to this error /dev/pts/zsh No Such file or directory

I have been told this might be a install issue, I have already tried reinstalling, It doesn’t work.

Can someone help me figure this out.

  • If you log in directly to the Kali device and run /bin/bash do you get an error or a shell? If you log into the Kali device and run su - user and give the password do you get an error or a shell? Please show the exact error messages. My first guess is that this is a line ending issue.
    – icarus
    Nov 27, 2020 at 15:10
  • 1
    You "set up /etc/ssh/sshd_config to use a password on login". What exactly did you do? Nov 27, 2020 at 15:19
  • @icarus no I do not get error for both the cases Nov 27, 2020 at 16:15
  • @MarkPlotnick yes I get the same error for ssh [email protected] Nov 27, 2020 at 16:15
  • 1
    That's vital information and explains the reason for the problem. Please add it to your question Nov 27, 2020 at 16:32

1 Answer 1


Thanks to @icarus, yes the issue was with the ChrootDirectory setting in /etc/ssh/sshd_config. Commenting out ChrootDirectory /home/remote worked. I worked out the cause for this issue from this question. Thank you everyone, I can't believe I missed something this silly.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .