DEV Community

naveen sanjula
naveen sanjula

Posted on

Day 1: Linux User Setup with Non Interactive Shell

To create a user named ravi with a non-interactive shell on App Server 1, follow these steps


✅ Linux CLI

  1. Access App Server 1 If you're managing multiple servers, first connect to App Server 1 via SSH
   ssh user@stapp01  # Replace `user` with the appropriate username
Enter fullscreen mode Exit fullscreen mode
  1. Create the user with a non interactive shell Use /sbin/nologin or /usr/sbin/nologin (depending on the distro)
   sudo useradd -s /sbin/nologin ravi
Enter fullscreen mode Exit fullscreen mode
  • -s /sbin/nologin sets the user's shell to "non interactive" (i.e., login access is disabled).

  • ravi is the username.

On some systems, the non interactive shell might be located at /usr/sbin/nologin. Use that if /sbin/nologin doesn't exist.

  1. Verify the user and shell Run
   grep ravi /etc/passwd
Enter fullscreen mode Exit fullscreen mode

Expected output

   ravi:x:1001:1001::/home/ravi:/sbin/nologin
Enter fullscreen mode Exit fullscreen mode

ssh steve@stapp02

(enter the password for steve user)

sudo -i

(again enter the password for steve user)

useradd amar -s /sbin/login

refer this link for usernames and passwords for different servers within nautilus.

Top comments (0)