Install and configure SFTP - Task Failed

Hi Admin/team,

I have done the task successfully as updated in the screenshot. Still my task shows as failed. Can someone check this one.

User is not able to do SSH and he is only able to do SFTP, still my task is marked as wrong. Pls assist.
I tried and updated user shell as both ‘/sbin/nolgin’ and also finally as ‘/bin/false’. Not sure why still shows as task failed.

You do not need to set the shell to /bin/false, just need to change some parameter in /etc/ssh/sshd_config file which will restrict it’s access to file transfer only.

I agree to some extent.

There will be multiple ways to reach a solution and mine was one of the way.

You see in the screenshot SSH is still not allowed for the user and as you said i have updated below entries in the file to make sure SSH is disabled and after updating settings in sshd config file i have restarted SSH service.

PasswordAuthentication yes
Subsystem sftp internal-sftp
Match User kareem
ChrootDirectory /var/www/opt
ForceCommand internal-sftp

1 Like

You need to check the message after you changed the configurations in sshd_config file.
If you set the shell /bin/false or /sbin/nologin, then there is difference in display message while doing SSH.
You just need to change below parameters in sshd_config
Match User john
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/www/data
PermitTunnel no -
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

Now, check the message after doing SSH.
It will display message like **This service allows sftp connections only Connection to localhost closed.
Might be this one of the reason your task got failed.

1 Like

I think the answer correction algorithm is looking for message “This service allows sftp connections only” and not the end results, though the end result is still user not able to do SSH and he is able to do SFTP. :slight_smile: