I have an idea, how to check availability of "id_rsa.pub" for each user in home directory. But something does not work. My script:
#!/bin/bash
users=`ls /home/`
for i in "$users"; do
if [[ -f "/home/$i/.ssh/id_rsa.pub" ]]; then
echo "All users have this key"
else
echo "Users $i don't have this key, We need build key for this users"
fi
done
In the debug:
+ [[ -f /home/donovan
valeri
john
roman
colbi
testuser/.ssh/id_rsa.pub ]]
How i see, it takes a full path, but don't full path for each user. Please help, what i do wrong ? Thanks for your attention. And of course, i have a result:
Users donovan
valeri
john
roman
colbi
testuser don't have this key, We need build key for this users