In the description you say the shell is to be /sbin/nologin but the script sets it to /bin/false. The usage message says <filename>, however the script expects userlist.
Use *) case pattern to trap everything else. Also exit with non-zero status when printing the usage string:
Last edited by Chubler_XL; 09-24-2019 at 10:27 PM..
hello
I have a number of lines that need to be added at the end of a file each time I add a field in another file (let's name it file2)
file2 has this format:
filed1:field2:path1:path2:path3:path...
Whenever I add a path field, I should add to file1 these lines:
<Location path1>... (0 Replies)
Hi I need help..........
I have an Sun One Directory server LDIF file with 5000 user entries, I need to change the data to match Test ID's, so I can run a perf test.
I'm way out of my league as I have not done any scripting for 10 years.
There are four entries for each user in the file... (3 Replies)
Ok, I have a script with a commandline option that allows the user to add a custom function to the script file. I have tried everything in my limited knowledge of sed to get this to work and keep coming up short. I need sed to search for a line starting with a pattern, I've got that part so far,... (0 Replies)
hi All, here is the problem: I'm not able to specify a PATH inside the user crontab file (/var/spool/cron/crontabs). The only syntax it accepts is the usual "* * * * * file" I'm not able to add PATH, or HOME, or MAILTO, or anything else. when I try to save the crontab, I have the error: ... (1 Reply)
Hello I would like to ask for help with a script to search a directory that contains many log files and based on a users input after being prompted, they enter a date range down to the hour which searches the files that contain that range.
I dont know how to go about this. I am hoping that the... (5 Replies)
i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled.
#!/bin/sh
echo " Enter your choice to continue y/Y OR n/N to quit "
read A
if
then
echo " user requested to continue "
##some commands... (7 Replies)
Hi,
I want to achieve something similar to what described in another post:
The difference is I want to add the line if the pattern is not found.
File 1:
A123, valueA, valueB
B234, valueA, valueB
C345, valueA, valueB
D456, valueA, valueB
E567, valueA, valueB
F678, valueA, valueB
... (11 Replies)
In the below bash a file is downloaded when the program is opened and then that file is searched based on user input and the result is written to a new file.
For example, the bash is opened and the download.txt is downloaded, the user then enters the id (NA04520). The id is used to search... (5 Replies)
Dear All,
It would be really nice, if you could help me to write a script for deletion of list of user( more than 15000 users) stored in a file and sorted by email address( i need deletion of only a particular type of mail address).
Is the any script to write and take the file as input and... (3 Replies)
Discussion started by: Chand
3 Replies
LEARN ABOUT SUNOS
pam_nologin
PAM_NOLOGIN(8) Linux-PAM Manual PAM_NOLOGIN(8)NAME
pam_nologin - Prevent non-root users from login
SYNOPSIS
pam_nologin.so [file=/path/nologin] [successok]
DESCRIPTION
pam_nologin is a PAM module that prevents users from logging into the system when /var/run/nologin or /etc/nologin exists. The contents of
the file are displayed to the user. The pam_nologin module has no effect on the root user's ability to log in.
OPTIONS
file=/path/nologin
Use this file instead the default /var/run/nologin or /etc/nologin.
successok
Return PAM_SUCCESS if no file exists, the default is PAM_IGNORE.
MODULE TYPES PROVIDED
The auth and acct module types are provided.
RETURN VALUES
PAM_AUTH_ERR
The user is not root and /etc/nologin exists, so the user is not permitted to log in.
PAM_BUF_ERR
Memory buffer error.
PAM_IGNORE
This is the default return value.
PAM_SUCCESS
Success: either the user is root or the nologin file does not exist.
PAM_USER_UNKNOWN
User not known to the underlying authentication module.
EXAMPLES
The suggested usage for /etc/pam.d/login is:
auth required pam_nologin.so
NOTES
In order to make this module effective, all login methods should be secured by it. It should be used as a required method listed before any
sufficient methods in order to get standard Unix nologin semantics. Note, the use of successok module argument causes the module to return
PAM_SUCCESS and as such would break such a configuration - failing sufficient modules would lead to a successful login because the nologin
module succeeded.
SEE ALSO nologin(5), pam.conf(5), pam.d(5), pam(7)AUTHOR
pam_nologin was written by Michael K. Johnson <johnsonm@redhat.com>.
Linux-PAM Manual 09/19/2013 PAM_NOLOGIN(8)