Submitted by hinhthoi on Mon, 05/23/2016 - 22:00
Hi,
I need to allow my users to use SFTP, but i also want to disable SSH access to them.
It seems SFTP only works for them if i allow SSH access to them.
Thanks for any help!
Status:
Active
Comments
Submitted by andreychek on Mon, 05/23/2016 - 23:51 Comment #1
Howdy -- if you change the user's shell to /bin/false, I believe that would do what you're after.
The user wouldn't have a working shell, but they should still be able to access SFTP.
Submitted by hinhthoi on Tue, 05/24/2016 - 00:43 Comment #2
Could you tell me where/how to change the user's shell?
Also, is there any way to automatically "change the user's shell to /bin/false" when a new virtual server/ user is created?
Thank you very much :)
Submitted by jimdunn on Tue, 05/24/2016 - 09:52 Pro Licensee Comment #3
from the command line, you can change the user's shell this way:
https://www.virtualmin.com/node/28386
you could also change it using the GUI...
https://www.google.com/search?q=how+change+shell+using+virtualmin&ie=utf-8&oe=utf-8
Submitted by andreychek on Tue, 05/24/2016 - 09:53 Comment #4
What jimdunn said is correct.
In the GUI, you can change the shell by going into Webmin -> System -> Users and Groups, and then select the username.
Also, to change the shell for users in the future, what you can do is go into System Customization -> Custom Shells. That screen allows you to choose what shell your users will receive.
Submitted by hinhthoi on Wed, 05/25/2016 - 10:23 Comment #5
Hi,
Thank you very much.
I have managed to change the default shells now.
Have a nice day!