I want to Loop through the homefolders and validate, if the path /home/\*/.ssh/authorized\_keys exists. If it exists, I want to remove the file .../.ssh/disabled\_authorized\_keys for the user, that has already the authorized\_keys file in his homefolder.

I have created this script so far, but it will remove all disabled\_authorized\_keys and not just for the users who have the authorized\_keys.

```
 for i in /home/*/.ssh/authorized_keys;
 do ii=`echo $i|awk -F '/' '{print $3}'` ;
 rm /home/$ii/.ssh/disabled_authorized_keys;
 done

```

Thank you in advance. (I'm an absolute beginner in bash scripting!)