- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: C programming question: how to verify userid/p...
Operating System - Linux
1753945
Members
8465
Online
108811
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО12-23-2003 03:50 AM
тАО12-23-2003 03:50 AM
C programming question: how to verify userid/password on Unix OS (hp or linux)
Hi,
Is there any functions that can be used to verify userid/password without worring about whereabouts of the password: /etc/passwd , /etc/shadow or somewhere else?
I am used to use 'getpwent' to do password verification on our HP machine, but when I moved the code to Linux, it didn't work because the encrypted password resides in /etc/shadow instead of /etc/passwd.
Any help is highly appreciated!
Liping
Is there any functions that can be used to verify userid/password without worring about whereabouts of the password: /etc/passwd , /etc/shadow or somewhere else?
I am used to use 'getpwent' to do password verification on our HP machine, but when I moved the code to Linux, it didn't work because the encrypted password resides in /etc/shadow instead of /etc/passwd.
Any help is highly appreciated!
Liping
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-23-2003 04:15 AM
тАО12-23-2003 04:15 AM
Re: C programming question: how to verify userid/password on Unix OS (hp or linux)
Hello Liping,
not sure if there is a way to avoid putting some logic about the passwd location into the
program, but using fgetpwent and/or the shadow
routines (man shadow) you should be able to get at the data you need.
Greetings, Martin
not sure if there is a way to avoid putting some logic about the passwd location into the
program, but using fgetpwent and/or the shadow
routines (man shadow) you should be able to get at the data you need.
Greetings, Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2003 12:39 AM
тАО12-30-2003 12:39 AM
Re: C programming question: how to verify userid/password on Unix OS (hp or linux)
When doing it from a shell script, you could do it with su:
su -c /bin/true
The problem with doing it from a C-program is that the encrypted passwd is not accessible for normal users, only root, on systems using the /etc/shadow (linux/solaris) or trusted (hp-ux) environments.
So, even if you do program it correctly, you have to have root privileges to make it work... meaning a new possible security hole. You might, of course, try the system command to start the su line like in a shell script. That should work...
su
The problem with doing it from a C-program is that the encrypted passwd is not accessible for normal users, only root, on systems using the /etc/shadow (linux/solaris) or trusted (hp-ux) environments.
So, even if you do program it correctly, you have to have root privileges to make it work... meaning a new possible security hole. You might, of course, try the system command to start the su line like in a shell script. That should work...
Every problem has at least one solution. Only some solutions are harder to find.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2003 08:54 AM
тАО12-30-2003 08:54 AM
Re: C programming question: how to verify userid/password on Unix OS (hp or linux)
Hi
There is pam Pluggable Authentication Module
There is pam Pluggable Authentication Module
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP