Deleting Login Keys

zomebodi

Verified User
Joined
Sep 3, 2023
Messages
61
Is it safe to delete login keys with this command?
search /usr/local/directadmin/data/users/ -type d -path '*/login_keys' -exec rm -rf {} \;

I have thousands of login_keys created for users, and I've noticed that logging in with these keys is becoming very slow.
 
Hello,

Probably you mean find, not search

But before removing, you might check a list of candidates for a removal:

Code:
find /usr/local/directadmin/data/users/ -type d -path '*/login_keys'

And though you won't break anything in DirectAdmin, and the control panel won't complain at all, you might first check logs:

Code:
/usr/local/directadmin/data/users/{USERNAME}/login_keys/{KEY_NAME}/key.log.1

for recent usages of the KEY, and list files modified within last 30 days:

Code:
find /usr/local/directadmin/data/users/*/login_keys/* -type f -mtime -30 -exec ls -lda {} \;

This way you can see which KEYS are in usage.
 
Back
Top