0

OS: ubuntu 14.04

I setup pam_mysql, and it's working. I can login sql users via regular ssh/sftp just fine. The problem comes when I try and sftp using CHROOT sql users. Anytime ls is entered it hangs.

Stops at:

root@default-ubuntu-1404:~# sftp test@localhost
Ubuntu 14.04.5 LTS
test@localhost's password:
Connected to localhost.
sftp> ls
... just hangs

Other commands work, (cd, pwd)

This seems to be a similiar issue: https://unix.stackexchange.com/questions/32882/sftp-server-on-rhel6-disconnects-on-ls

"This ended up being an issue with Likewise Open. "ls" was the only command that try to resolve UID/GID when sftp'ing, and in doing so, it went to likewise for resolution, and as soon as it did, it crashed."

I can't wrap my head around it, but once the user is inside of the chroot env it can't get uid/gid info is my guess.

Kyle
  • 31
  • 1
  • Make sure the directory in question doesn't have a massive number of files in it. This is known to cause that problem. – Andrew B Dec 07 '16 at 06:37
  • No that's not it there are only a test directory and file I created. Thanks for the response though. – Kyle Dec 07 '16 at 19:32

1 Answers1

0

So it's not "solved" the way I want it to be, but I figured out a work around.

Creating a /etc/passwd and /etc/group files inside of the chroot folder of the user solves the problem.

Not a great work around but it works, I need to populate the /etc/passwd and /etc/group file with the values from getent passwd for the pam_mysql users.

Im working to make a script to create these with pam_exec on user login.

root and the user's uid/gid should be all that's needed in each user's chroot.

Kyle
  • 31
  • 1