User tc
Aim is to add another user which can be used for ssh access.
Then allow to switch to the default user tc.
With the default sshd configuration it is not allowed to login to a passwordless user.
User tc has no password set by default and I prefer to keep it passwordless.
As a next step public-key authentication can be enabled to directly login to user tc.
- Add a user with a password:
- sudo adduser <username>
From this point you can login with ssh as user <username>.
It is not yet possible to execute commands that require root privileges.
- From user tc login as root and make <username> a sudo user:
- sudo su
- chmod 660 /etc/sudoers
- vi /etc/sudoers
- add:
<username> ALL=NOPASSWD: ALL
- chmod 440 /etc/sudoers
- exit
- sudo vi /opt/.filetool.lst
- add:
etc/sudoers
- backup
From this point you can also execute commands that require root privileges for user <username> using 'sudo'.
- Switch to user tc after login with user <username>
- sudo su - tc
or - sudo su -
- To switch to root from user <username> use:
- sudo su
- From root you can switch to user tc with:
- su - tc
- Use 'exit' to switch one step back.