Moxa UC-8410A-LX [13/86] Bcreating and deleting user accounts

Moxa UC-8410A-LX [13/86] Bcreating and deleting user accounts
UC-8410A Series Linux Software Getting Started
2-7
User Account Management
Switching to the Root Account
You can switch to the root user account using sudo -i (or sudo su). command. For security reasons, do not
operate
all” commands from the root account.
NOTE
Click the following link for more information on the sudo command:
https://wiki.debian.org/sudo
ATTENTION
You m
ight get a permission denied message when you use pipe or redirect behavior with a non-
root account.
You must use
‘sudo su –c’ to run the command instead of using >, <, >>, <<, etc.
Note
: The single quotes around the full command are required.
Creating and Deleting User Accounts
You can use the commands useradd and userdel to create and delete user accounts. Refer to the main page
of these commands to set relevant access privileges for the account. The following example shows how you can
create a user,
test1 in the sudo group. The default login shell for the user is bash and the home directory is
/home/test1.
moxa@Moxa:~# sudo useradd -m -G sudo -s /bin/bash test1
To change the password of test1, use the passwd command and enter the new password twice to confirm the
change as shown below:
moxa@Moxa:~# sudo passwd test1
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
To delete the test1 user, use the userdel command as follows:
moxa@Moxa:# sudo userdel test1
Disabling the Default User Account
ATTENTION
You should first create a user account
before you disable the default account.
Use the passwd command to lock the default user account so the user, moxa cannot log in.
root@Moxa:# passwd –l moxa
To unlock the user account moxa, use the following command:
root@Moxa:# passwd –u moxa

Содержание

Скачать