Sometimes when I am working on a project and come across a new powerful Linux command, I need to test it. With a live dedicated server, that can be a recipe for disaster. Rather than taking such a risk with your websites and possibly the websites of customers (if you also host sites), I recommend creating test accounts.
A test user will have a unique set of configuration settings, its own home folder, and its own username and password. The second dilemma I encountered, however, was that once the account was created, I did not want to always have to log out of SSH and then login as the other user. In fact, for security reasons, I did not want the test user to have SSH access all.
Normally, the “su” command is used to become root, but you can also use it to login as any other user, directly from your SSH command prompt. To execute the command, type:
su -- username
It will then ask you for the specified user’s password. Enter it, and you are ready to test.
Image Source: Oxygen icons