$ passwd sftpuser
Changing password for user shahrilk.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
Check the user information is available inside the /etc/passwd file using below grep command,
$ cat /etc/passwd|grep sftpuser
Step 2: Add permission to Directory
Below chown command is you to provide access rights to sftpuser to access the mentioned directory path.
$ chown -R sftpuser:sftpusers /data/dirstatinfo/csvfiles
Step 3: Configure SSH Protocol
Now we are going to configure the ssh protocol to create an SFTP process. You can done this through editing the configuration file "/etc/ssh/sshd_config".
Add these lines end of the configuration file and changed directory name according to your requirement.
$ vim /etc/ssh/sshd_config
Subsystem sftp internal-sftp
Match Group sftpusers
ChrootDirectory /path/to/files
ForceCommand internal-sftp
Step 4: Enable Chroot For Directory
Run below setsebool command to enable the chroot on your directory.
$ setsebool -P ssh_chroot_rw_homedirs=1
Step 5: Restart the SSH Service.
After making the changes in sshd_config file, we need to restart the ssh service. use below command,
$ /etc/init.d/sshd restart
Nice work Prashant
Keep it up
Hi,
I want to copy folder with date and time stamp from one linux server to another linux server using SFTP, Is there any script for that ?