Disable SSH Acess

You normally create packages for users (and for resellers). Just don't select the "ssh" option for users.

You can change it on a per user base, that is the example the link is showing. But if you disable it in all packages, and you don't have users with things adjusted this way, then all users do not have SSH.

By default, users do not have SSH access. So if there are user who do, you must have given them access somehow. Probably via their packages.
 
You do that in the user account settings as a reseller or admin.
Its also possible to disable SSH access on a package bases.

https://www.ipserverone.info/knowle...-ssh-access-to-a-user-account-in-directadmin/ (This will help you find the SSH setting.) (This is NOT my site nor do I have a part in it.)
This can do only one by one. i aready enable ssh for more than 40 accounts. so now i need to disable it. Any option to do it with a single command or not
 
maybe
put AllowUsers to
/etc/ssh/sshd_config
Code:
AllowUsers admin
and do "service sshd restart"
this'll restrict access only admin,
 
Last edited:
I wouldn't do it that way, because if enabled with packages, on some rebuild they might get back in.

This can do only one by one. i aready enable ssh for more than 40 accounts. so now i need to disable it. Any option to do it with a single command or not
40 accounts is not a lot, however there is a way.

First take care that SSH is not enabled on any package anymore. Maybe that also works with the first of these commands:
Code:
perl -pi -e 's/ssh=ON/ssh=OFF/' /usr/local/directadmin/data/users/*/packages/*.pkg
perl -pi -e 's/ssh=ON/ssh=OFF/' /usr/local/directadmin/data/users/*/domains/*.conf
perl -pi -e 's/ssh=ON/ssh=OFF/' /usr/local/directadmin/data/users/*/user.conf

Use at your own risk. It might be wise to restart DA after these changes, just to be sure.
Be aware that there is a chance this also disables admin SSH login, if yes, you have to enable that again.
 
Is this question now answered? If so could you mark it as solved? Thanks.
Trying to increase your postcount by asking this to everybody? :)
It will never be that all users will do this and it will also not be done with old existing posts. So asking this everywhere won't have a big effect except for bumping threads which don't need bumping.
 
Trying to increase your postcount by asking this to everybody? :)
It will never be that all users will do this and it will also not be done with old existing posts. So asking this everywhere won't have a big effect except for bumping threads which don't need bumping.
No I am not doing this to up my posts. I am doing this since I, at some point have responded in the issue. And want to make sure its resolved and I can unwatchable it. :)
 
Ah oke, no problem. I've seen you doing that in several posts, but didn't take notice if you had responded in there, so I thought you took the job on yourself to learn people to set posts to fix. ;)
As admin of forums I know this will not work so I thought I would mention it. As for the postcount, I posted a smilie so I didn't really mean that seriously. ;)
But now I know why you did it.
 
As for the postcount
In an effort to up my post count I would like to respond to this post with some comments about something I want to say to you all but I am actually so old I have now forgotten well anyway I hope this stream of conciseness does not lead you to think I am just posting to post.:ROFLMAO:
Oh and by the way Mark it as solved....:)
 
Back
Top