new shared public
This commit is contained in:
@@ -64,7 +64,7 @@ function validate_users() {
|
||||
|
||||
cd /var/ssh-box/users
|
||||
validate_users
|
||||
|
||||
mkdir -p /shared/
|
||||
for file in *; do
|
||||
if [[ "$file" =~ ^([0-9]+)-([a-z][a-z0-9_]*)$ ]]; then
|
||||
uid=${BASH_REMATCH[1]}
|
||||
@@ -83,10 +83,18 @@ for file in *; do
|
||||
rm -f "/home/$user/.ssh/authorized_keys"
|
||||
get_readme > "/home/$user/README.md"
|
||||
mkdir -p "/home/$user/shared" "/home/$user/private"
|
||||
ln -sfT "/shared" "/home/$user/public"
|
||||
chown -R "$user":box "/home/$user/shared"
|
||||
chown -R "$user":"$user" "/home/$user/private"
|
||||
chmod -R u+rwX,g+rwX,o+X "/home/$user/shared"
|
||||
chmod g+s "/home/$user/shared"
|
||||
chmod -R u+rwX,g-rwX,o-rwX "/home/$user/private"
|
||||
if [[ -e "/home/$user/.shared.is.listed" ]]; then
|
||||
ln -sfT "/home/$user/shared" "/shared/$user"
|
||||
else
|
||||
echo "rename this file to '.shared.is.listed' to display shared folder in ~/public/" > "/home/$user/.shared.is.not.listed"
|
||||
rm -f "/shared/$user"
|
||||
fi
|
||||
chmod 0600 "$file"
|
||||
chown $USR "$file"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user