Answer the question
In order to leave comments, you need to log in
How to differentiate user rights on a linux server?
There are users on the server. Each user has their own home directory:
/home/user1
/home/user2
/home/user3
Answer the question
In order to leave comments, you need to log in
Something like this:
mkuser () {
mkdir -p ${user_homedir}
useradd -d ${user_homedir} -s /bin/bash ${user}
usermod -a -G secure ${user}
echo "User ${user} created"
user_set_login_type
random_password_for_user
chown root:root /home/${user}/
chmod 755 /home/${user}/
chown ${user}:secure ${user_homedir}
chmod 705 ${user_homedir}
mkdir -p ${user_homedir}/www
mkdir -p ${user_homedir}/mod-tmp
chown -R ${user}:${user} ${user_homedir}/*
chown -R ${user}:www-data ${user_homedir}/mod-tmp/
chmod -R 770 ${user_homedir}/mod-tmp/
chmod -R 755 ${user_homedir}/*
}
This will prevent users from reading files from other hamsters.
You can glue vsftpd with a chroot on top - https://debian.pro/72
https://debian.pro/24 - chroot into a hamster for
sftp read this - https://debian.pro/1237
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question