aker-gateway / Aker

SSH bastion/jump host/jumpserver
Other
566 stars 71 forks source link

new day logs folder limit only to the first user #85

Open brosky opened 5 years ago

brosky commented 5 years ago

It seems that the first user that uses aker during a day sets wrong permissions:

drwxrwxrwx. 4 brosky brosky 33 Feb 12 12:48 20190212 drwxrwxr-x. 3 brosky brosky 18 Feb 13 08:53 20190213 -rwxrwxrwx. 1 root root 93922 Feb 11 17:50 aker.log <- don't know why this does not update anymore

As I understand, the first user that logs in it created the folder /var/log/aker/$YearMmonthDay with 775 permissions thus rendering next users to not be able to log in to remote hosts.

After changing the $YearMmonthDay to 777 then other users can connect to remote hosts.

anazmy commented 5 years ago

Let me test this

anazmy commented 5 years ago

the code has 777 only set. I did't find a code path that can lead to 775.

Was umask settings changed on the server at any point?

anazmy commented 5 years ago

I think finishing #80 will help here as well

brosky commented 5 years ago

i've "fixed" this with a */5 crontab script:

#!/bin/bash
today=$(date +%Y%m%d)
chmod 777 /var/log/aker/$today