I have installed ubuntu with two folders i.e. / and /home with swap area. I have made two users in /home. But User1 can check the data of User2 and hence vice-versa. I wish to restrict one user to see other's data. Please suggest me how to do so. Thanks in advance.
Although the other answer is completely correct, note that this is a call each user can do. When you log in you can see the permissions on your home directory:
$ ls -ld $HOME rwxr-xr-x 111 rmano rmano 12288 Feb 10 14:13 .
rwx means that the owner can read, write and cross(1) the directory. The members of group
rmano can just read and cross. The last triple specify what to do with "others" users. So if you do (as user):
chmod o-rwx $HOME
you will restrict the access to all "other" users. (Don't do that with the group, it's not needed. In a normal installation you are the only member of your group). Now:
$ ls -ld $HOME rwxr-x--- 111 rmano rmano 12288 Feb 10 14:13 .
This is the same effect of the other answer; but keep clear that even if you change permissions with the root account, the user can still decide to change the permission back to make his/her files visible.
x means execute for files, "cross"for directories.