Suggested Answer:See explanation below.
useradd eric passwd eric vi /etc/passwd eric:x:505:505::/home/eric:/sbin/nologin Which shell or program should start at login time is specified in /etc/passwd file? By default, Redhat Enterprise Linux assigns the /bin/bash shell to the users. To deny the interactive login, you should write /sbin/nologin or /bin/ false instead of login shell.
$useradd -m -s /sbin/nologin eric; echo "password" | passwd --stdin eric
use above in case future wise you may need to enable it and also to test it as per below..always test DO NOT assume!!
$ssh eric@localhost => put password you should get below message
This account is currently not available.
onnection to localhost closed.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
cloudyhr
Highly Voted 2 years, 11 months agoLazylinux
Most Recent 3 months, 2 weeks ago