I am confused as to why I'm having problems executing a history command as another user to retu all that user's history - I need to loop though all users and get their history
cat /etc/passwd | awk -F: '{print $1}' > ${system}.users.txt
while read useame; do
echo $useame
sudo -u $useame bash -c 'export HISTTIMEFORMAT="%F %T "; history' >../log/${useame}.hist
#sudo -u $useame bash -c 'export HISTTIMEFORMAT="%F %T "; history'
done < ./${system}.users.txt
I get no history output when I run: sudo -u anotheruser history
to troubleshoot I tried: sudo -u anotheruser bash -c 'which history'
Also I ran : sudo find / -name 'history' -type f
and I get no retued executable.
Can anybody tell me why a sudo command can't be executed by another user?
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 180
تاريخ: چهارشنبه
5 خرداد
1395 ساعت: 11:55