I have a question regarding changing the home folder for a user on the system. I was thinking I could do something like:
new_folder_name="$2"
user_name="$3"
mkdir /home/$new_folder_name
usermod -d -m /home/$new_folder_name/$user_name
This unfortunately did not work and now I feel kinda lost. Anyone have some advice on how to do this?
I used mkdir /home/$2
chown $3:$3 /home/$2
chmod 700 /home/$2
usermod --home /home/$2 $3
instead, which works, but it prints chown: invalid group:username:username afterwards, why is that?