mirror of
https://github.com/atmoz/sftp.git
synced 2024-11-17 12:51:33 -05:00
modify /home to corrent permissions while it may be mounted with wrong permissions
This commit is contained in:
parent
eacf693131
commit
fd87bcb829
1 changed files with 5 additions and 0 deletions
|
@ -55,6 +55,11 @@ if [ ! -f "$userConfFinalPath" ]; then
|
||||||
|
|
||||||
# Check that we have users in config
|
# Check that we have users in config
|
||||||
if [ -f "$userConfFinalPath" ] && [ "$(wc -l < "$userConfFinalPath")" -gt 0 ]; then
|
if [ -f "$userConfFinalPath" ] && [ "$(wc -l < "$userConfFinalPath")" -gt 0 ]; then
|
||||||
|
if [ -n "$(find /home -perm /go=w -o \! -user root -maxdepth 0)" ]; then
|
||||||
|
log "Modify /home to have the correct permissions, as it may be mounted with the wrong permissions."
|
||||||
|
chmod go-w /home
|
||||||
|
chown root /home
|
||||||
|
fi
|
||||||
# Import users from final conf file
|
# Import users from final conf file
|
||||||
while IFS= read -r user || [[ -n "$user" ]]; do
|
while IFS= read -r user || [[ -n "$user" ]]; do
|
||||||
create-sftp-user "$user"
|
create-sftp-user "$user"
|
||||||
|
|
Loading…
Reference in a new issue