![]() ![]() In above ‘sshd_config’ file we have commented out the line which starts with “Subsystem” and added new entry “Subsystem sftp internal-sftp” and new lines like, To make above changes into the affect, restart ssh service using following systemctl command :~# systemctl restart sshd #Subsystem sftp /usr/lib/openssh/sftp-server ![]() Step:3) Edit sftp configuration file (/etc/ssh/sshd_config)Īs we have already stated that sftp operations are done over the ssh, so it’s configuration file is “ /etc/ssh/sshd_config“, Before making any changes I would suggest first take the backup and then edit this file and add the following content, :~# cp /etc/ssh/sshd_config /etc/ssh/sshd_config-org :~# vim /etc/ssh/sshd_config Note: User like Jonathan and Chris can upload files and directories to upload folder from their local systems. Now set the required permissions on Users, :~# chown root /home/jonathan /home/chris/Ĭreate an upload folder in both the user’s home directory and set the correct ownership, :~# mkdir /home/jonathan/upload :~# mkdir /home/chris/upload :~# chown jonathan /home/jonathan/upload :~# chown chris /home/chris/upload In case you want to add existing users to ‘sftp_users’ group then run beneath usermod command, let’s suppose already existing user name is ‘chris’ :~# usermod -G sftp_users chris Set the password using following chpasswd command, :~# echo "jonathan:" | chpasswd ![]() Let’s suppose user name is ’Jonathan’ :~# useradd -m -G sftp_users jonathan In case you want to create new user and want to add that user to ‘sftp_users’ group, then run the following command, Open the terminal, create a group with a name “ sftp_users” using below groupadd command, :~# groupadd sftp_users Step:2) Add Users to Group ‘sftp_users’ and set permissions Let’s jump into SFTP Configuration Steps, Step:1) Create a Group for sftp using groupadd command ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |