SFTP
#C7254E
#F9F2F4
::add_user
$ usermod -l newuser userA
$ useradd newuser
$ useradd -d /home/newuser -m -G sftponly newuser
::add_group
$ groupmod -n sftponly sftp
$ groupadd sftponly
$ grep 'sftponly' /etc/group
::add_member_to_group
$ usermod -a -G sftponly newuser
$ usermod -d /home/newuser newuser
::SFTP
$ chmod 755 /home/newuser
$ chown root:root /home/newuser
$ chmod 700 /home/newuser/upload
$ chown newuser:newuser /home/newuser/upload
OR
$ chmod 777 /home/newuser/upload
$ chown root:root /home/newuser/upload
$ vi /etc/ssh/sshd_config
#Subsystem sftp /usr/lib/openssh/sftp-server #PasswordAuthentication yes Subsystem sftp internal-sftp #Match Group *,!sudo Match Group sftponly ForceCommand internal-sftp -d /upload PasswordAuthentication yes ChrootDirectory %h AllowTcpForwarding no X11Forwarding no
$ systemctl restart sshd
ไม่มีความคิดเห็น:
แสดงความคิดเห็น