I created a new user with no shell access like this:
useradd -g www -d /www/user01 -p ****** -s /sbin/nologin user01
Then in my sshd_config
I add those lines:
AllowUsers user01 user02 manager
Subsystem sftp internal-sftp
Match User user01
ChrootDirectory /www/user01
PasswordAuthentication yes
ForceCommand internal-sftp
The problem is I got Access denied every time I log in with putty, is there any misconfiguration?
UPDATE:
It appears that the only user can ssh is the root
user, even adding the new user to AllowUsers
directive.
/www/user01
owner and permissions?/www
toroot:root
, and/www/user01
touser01:www
, but then I lost readability for nginx without to mention I am still can't login via ssh.I am still can't login via ssh.
why would you think that you would be able to login with ssh/putty? You have set a force command to only permit sftp clients.ForceCommand internal-sftp
, or keeping it and login with sftp client WinSCP, it fails.