sudo chmod -R g-wrx,o-rwx /home/*
Then in each user's .bashrc file, append on a new line at the bottom:
So the default newly created files will have permissions denying other users to read write or execute.
And append the
to the end of it too.
This will cause any new users you create to automatically have the umask 077 in the .bashrc, so you do not have to manually edit each one after creating a new user.
After that, you can test it.
sudo su - user2
(Enter your users password)
su means switch user. Using sudo before it means you won't need to know user2's password to switch to that user. This only works if sudo is installed and configured and your user is a member of the wheel or sudo group. Ubuntu does this by default for the first user created during installation.