@Xiuning Would you please take a look and give some suggestion? I don't suggest this solution for using in long term which skip call pam-systemd.so to fix this issue, Sftp sends files and call pam-systemd.so to create session which manage resources more reasonable, this is evolution direction of systemd upstream. Systemd don't have better solution and Kernel cgroup maybe give a better one for this issue.