How can I restrict a user to access DA...

I don't believe you can do it, and I've made your post a feature request.

The way I do it now is I insert a ~ character as the first letter of the password in the /etc/shadow file. this will keep the password from working, and it will start working again when you remove the ~.

Note this will also block the password from being used for both email and for FTP, SSH, etc., for that use, so you may not want to do that.

Note also that should only edit /etc/shadow with an editor designed for the purpose, since if the file is changed by DirectAmdin (for example to add, delete, or edit users or passwords), those changes could overwrite yours or you could overwrite them. If you're not sure of a write-locking editor for your OS distribution, then rename the file (which will keep others from logging in or changing the file), then edit in, then rename it back.

Jeff
 
Hello,

Here's the quick answer:
http://www.directadmin.com/features.php?id=1223

Code:
#!/bin/sh
BLOCKED=/root/blocked_da_users.txt
COUNT=`grep -c "^${username}\$" ${BLOCKED}`
if [ "${COUNT}" -gt 0 ]; then
        echo "Blocked Username";
        exit 1;
fi
exit 0;
and add Users to the file:
/root/blocked_da_users.txt

one on each line.
You can add /root/blocked_da_users.txt to the template:
/usr/local/directadmin/data/templates/edit_files.txt

if you want to edit the list from within DA.
Copy edit_files.txt to:
/usr/local/directadmin/data/templates/custom/edit_files.txt
and use the custom version for your changes.

John
 
Back
Top