- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need to get password Attributes
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2011 07:07 PM
тАО06-01-2011 07:07 PM
Need to get password Attributes
Kindly help me how to get the followin following attributes through a command.
I can understand that I can view them in /etc/default/security file. But I need to find them through command.
PASSWORD_HISTORY_DEPTH
ABORT_LOGIN_ON_MISSING_HOMEDIR
MIN_PASSWORD_LENGTH
PASSWORD_MIN_UPPER_CASE_CHARS
PASSWORD_MIN_DIGIT_CHARS
PASSWORD_MIN_SPECIAL_CHARS
PASSWORD_MAXDAYS
PASSWORD_MINDAYS
PASSWORD_WARNDAYS
Thanks in Advance!!!
- Tags:
- Password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2011 07:31 PM
тАО06-01-2011 07:31 PM
Re: Need to get password Attributes
> command.
cat /etc/default/security
What, exactly, do you mean? What, exactly,
does "find them through command" mean to you?
What, exactly, would you like to do?
grep PASSWORD_HISTORY_DEPTH /etc/default/security
There it is. Now what?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2011 07:47 PM
тАО06-01-2011 07:47 PM
Re: Need to get password Attributes
I can understand that I can grep.
I am writing a script to review hardening policies.
If I grep from that file and then compare values, it will make it length.
In order to find the umask, we will use the command umask. In the similar way if there is any specific command(s) which gives me the output for the above attributes.
For eg regarding PASSWORD_HISTORY_DEPTH, If my PASSWORD_HISTORY_DEPTH is 5, then if I am able to get a command which gives me this value directly, I will be able to assign it to a variable and compare with the actual hardening policy.
This will reduce time and length of the script.
Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2011 08:20 PM
тАО06-01-2011 08:20 PM
Re: Need to get password Attributes
Should I have known that?
> [...] assign it to a variable [...]
Should I have known that?
> I can understand that I can grep.
That's good, but you seem to need to learn
some shell script basics. For example, ``
or $() can be used to work with the output of
a command (or pipeline).
phd=` grep PASSWORD_HISTORY_DEPTH \
/etc/default/security | \
sed -e 's/.*=//' `
echo $phd
Interactively:
dyi # phd=` grep PASSWORD_HISTORY_DEPTH \
> /etc/default/security | \
> sed -e 's/.*=//' `
dyi # echo $phd
4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2011 09:10 PM
тАО06-01-2011 09:10 PM
Re: Need to get password Attributes
Actually I have another issue even.
There are few entries in that file which is already commented.
So If two PASSWORD_HISTORY_DEPTH(one commented) exist in the file, then that will cause problem again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2011 10:57 PM
тАО06-01-2011 10:57 PM
Re: Need to get password Attributes
SO you had:
phd=` grep PASSWORD_HISTORY_DEPTH \
/etc/default/security | \
sed -e 's/.*=//' `
echo $phd
That could become:
phd=` sed -e 's/#.*//g' -e '/^$/d' \
/etc/default/security | \
grep PASSWORD_HISTORY_DEPTH | \
sed -e 's/.*=//' `
echo $phd
You could probably make this more efficient by combining those sed calls into one, but I've left them seperate so you can get a feel for what is happening here...
HTH
Duncan
I am an HPE Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2011 08:06 AM
тАО06-02-2011 08:06 AM
Re: Need to get password Attributes
How easy is it to find a blank line which
also has the desired keyword on it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2011 09:39 AM
тАО06-02-2011 09:39 AM
Re: Need to get password Attributes
>> also has the desired keyword on it?
Ha! I take your point - I guess I was using it out of context - I'm in the habit of always putting those two sed constructs together as I'm ass-u-me(ing) the output will be read by a person rather than another command in a pipeline...
for example... I don't like the output of:
swlist -l fileset -a state
I much prefer to look at :
swlist -l fileset -a state | sed -e 's/#.*//g' -e '/^$/d'
So I left it in in this case cos I thought the original poster might be curious enough to deconstruct the pipeline, and it would show him a cleaner output...
HTH
Duncan
I am an HPE Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2011 01:13 PM
тАО06-02-2011 01:13 PM
Re: Need to get password Attributes
> be curious enough [...]
I wish, but there's not much evidence for it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2011 07:45 AM
тАО06-03-2011 07:45 AM
Re: Need to get password Attributes
phd=` grep ^PASSWORD_HISTORY_DEPTH /etc/default/security ...
thus anchoring the expression to the beginning of the line. ("man 5 regexp" if you need further info).
-db