To accommodate the backup agent tool's specifications, the system admin team at xFusionCorp Industries requires the creation of a user with a non-interactive shell. Here's your task:
Create a user named james with a non-interactive shell on App Server 2.
-
SSH into the Server:
- Connect to
App Server 2
using SSH.
ssh steve@stapp02
- Connect to
-
Switch to the Root User:
- After connecting, switch to the root user to have the necessary permissions for creating a new user.
sudo su
-
Verify the User Doesn't Exist:
- Check if the user
james
already exists.
id james id: ‘james’: no such user
- Check if the user
-
Create the User with a Non-Interactive Shell:
- Use the
useradd
command to create the userjames
with the/sbin/nologin
shell. This shell prevents the user from logging in interactively.
useradd james -s /sbin/nologin
- Use the
-
Verify User Creation:
- Check that the user has been created and verify the details.
id james
You should see output similar to:
uid=1002(james) gid=1002(james) groups=1002(james)
-
Verify the User's Shell in
/etc/passwd
:cat /etc/passwd | grep james
The output should be:
james:x:1002:1002::/home/james:/sbin/nologin