You can deactivate a user account on Ubuntu by using command-line. There’s a GUI-way of doing this, of course; but command-line approach of doing this very straightforward and easy.
The following command will deactivate a user’s password thus disallowing him to log in. Open terminal and execute the following command replacing username with that user’s username:
sudo passwd -l username
Now to re-enable that user’s account, simply execute the following command replacing username with that user’s username:
sudo password -u username
Remember that, all files and folders belonging to that user will remain intact even though you deactivate his/her account. Those files/folders would be available upon re-enabling the user account.