SFTP journey
To set up an SFTP server for your existing user karl , allowing uploads to /var/www and its subdirectories while still providing SSH access without restricting him to SFTP only, follow these steps: Prerequisites Ensure you have root or sudo access to the server. OpenSSH server should be installed. Steps Open SSH Configuration File : sudo nano /etc/ssh/sshd_config Add/Modify SFTP Configuration : Find the section related to Subsystem sftp . If it exists, it may look like this: Subsystem sftp /usr/lib/openssh/sftp-server If it doesn't exist, you can add it. After that, add a new section for the karl user. Place this below the Subsystem sftp line: Match User karl ChrootDirectory /var/www ForceCommand internal-sftp AllowTcpForwarding no X11Forwarding no Set Permissions : The ChrootDirectory must be owned by root and not writable by anyone else. Adjust permissions as follows: sudo chown root:root /var/www sudo chmod 755 /var/www For any subdirectories where karl s...