Hello, I want to create a user that can only connect with ssh and be denied when trying to connect to FTP. Also, I want to remove his permissions like 'rm -r -f dir' How would I do this?
|
CentOS
Creating a user |
|
Dec 22, 2015 11:57 AM
(This post was last modified: Dec 22, 2015 11:59 AM by Betty Blue.)
To remove permissions to delete a directory change the permissions so that the user can't execute. Loki123 has an excellent guide on permissions that I believe is still stickied.
What FTP server are you using? It will be done in the configuration file to deny acess, however I would try to do this with TCP wrappers first if it were me. Using TCP wrappers you can do something like this: PHP Code
XMPP: pm me
As Dead Head said, check out my permission guide at the top of this section.
About allowing user to only connect through SSH or FTP then I assume that TCP wrappers isn't the method you want to use. TCP Wrappers is a host based networking.. I doubt it is capable of allowing you to control access based on users considering what it is. At most it would be able to block the IP address of `bob` to use FTPD but if he connects from his internet café instead of the IP blocked he would succeed in connecting to FTPD. Groups is what OP needs. You need to explicitly allow the user/group to access SSH in the SSHD configuration and explicitly enable or disable FTP access in the FTP configuration. Another, better method, is to create a group as mentioned in the permissions guide. Then set the configuration files for SSHD and FTPD to only allow access from users within those groups.. That gives you much easier control over users that are allowed to connect in a specific way. For example for sshd_config you would need to add the option AllowGroups and remove the option AllowUsers. PHP Code Make sure AllowUsers does not exist as it overwrites the AllowGroups option. If it exists then only users that mach that pattern are allowed. The same thing can be done for FTPD too. Just depends on your FTPD server on how the configuration syntax is. Read up on it and try it after reading up on how the permissions work. Doing this will increase your knowledge on the permissions system very well as well as it also holds hands with the other question you mentioned. |
|
|


