9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i vi .profile Set DATE `date +%m%d%Y%H%M`, but after logout/login, echo $DATE, it shows: Fri Mar 23 15:01:53 EDT 2012, i want to show: 032320121501
please ignore.
vi /etc/profile, and export DATE=`date +%m%d%Y%H%M`, worked fine now. (0 Replies)
Discussion started by: lawsongeek
0 Replies
2. Shell Programming and Scripting
Could you please explain me what is the difference between .login, .tcshrc ,.profile file . Can I keep .tcshrc file in two different location .Actually my problem is I have one server in which another server is mounted so I have two programs which refers to two different versions of java and I need... (1 Reply)
Discussion started by: maitree
1 Replies
3. Solaris
Greetings! I'm new here and excited to get aquianted with this site! Seems like a good source of knowledge!
Anyways, my first problem de'jour deals with the following....
We have dual monitors(top/bottom) for our system. The problem is that the solaris login window is split between the top... (7 Replies)
Discussion started by: ruberked
7 Replies
4. UNIX for Dummies Questions & Answers
Hey everyone,
I'am a little new here and experincing Unix for the first time. I was wondering if somone could help me with this question i'am a bit stuck on
Looking at the content of .profile login script
The .profile file is in your login directory. It is a startup script file... (1 Reply)
Discussion started by: worldsoutro
1 Replies
5. UNIX for Dummies Questions & Answers
Hello All,
My Problem is -> How can we get UNIX id from open mail authentication (Windows ID) in UNIX.
In following command we are using domain name, which may change in your reference.
As, if we use following command.
ypcat passwd | grep rohitp | cut -d: -f5 | cut -d, -f1
=> we get... (0 Replies)
Discussion started by: pandey.rohit
0 Replies
6. UNIX and Linux Applications
Dear experts ...
Please any one can describe the diffrence between this three
1) . cshrc
2) .profile
3) .login
cheers
syed (1 Reply)
Discussion started by: smuqtaderali
1 Replies
7. UNIX for Dummies Questions & Answers
I have modified the .profile in my profile and I don't see any effect.
Why the changes don't have effect?
I tried both on the account at a server where I have limited permissions as user and to my local pc (as user).
Is it the .profile overridden by some other file? It looks weird because I... (8 Replies)
Discussion started by: myle
8 Replies
8. UNIX Desktop Questions & Answers
Dear Friends
I'm using Hp-unix release b.11.11 and i'm facing a problem to login through telnet session. i can login only by user root but other users can not login.
but if i use x window application like (reflection X) all users can login with no problem.
please kindly advice me on how to... (0 Replies)
Discussion started by: hai_jab
0 Replies
9. UNIX for Dummies Questions & Answers
Hello again !
Thanks for response of my first question. there is my second quesiton why i have local.profile instead of .profile file ?
my all files in pwd shoes local. before any file.
is anybody can tell me about that ?
Thanks
Abid Malik (5 Replies)
Discussion started by: abidmalik
5 Replies
authenticate_user(3x) authenticate_user(3x)
Name
authenticate_user - authenticate user
Syntax
#include <pwd.h>
#include <auth.h> /* For error codes */
int authenticate_user(user, password, line)
struct passwd *user;
char *password;
char *line;
Arguments
user The UID.
password
The password for the UID.
line The name of the login line as it is listed in
Description
The routine authenticates a username/UID against a supplied password and returns a nonnegative integer on success. The value returned is
the number of failed login authentication attempts since the last successful login authentication (or zero if this feature is not enabled).
This routine is found in the library and loaded using the -lauth option.
At all security levels higher than BSD, the login fail count in the auth database is incremented if authentication fails, and cleared if it
succeeds. In addition, the account must be marked enabled for logins as defined by the Account Mask value for A_LOGIN. See for informa-
tion about the Account Mask values.
If a non-NULL value is supplied for the argument and the argument is not the empty string, the function also verifies that the specified
user is allowed access through that line. In particular, accounts with UID equal to zero will only return success if the specified line is
marked secure in the file.
Restrictions
The process must have read access to the auth database to authenticate users in a secure environment.
The process must have read/write access to the auth database to update the authentication fail count.
If auth information is being served through BIND, the process is required to obtain a Kerberos ticket for that service before invoking this
function.
Example
extern int errno;
struct passwd *pwd;
int status;
pwd = getpwnam("root");
status = authenticate_user(pwd, "rootpass", "/dev/console");
if(status < 0)
if(errno == EPERM)
puts("Login failed");
else
perror("authenticate_user");
else
if(status > 0)
printf("%d failed attempts
", status);
Return Values
When successful, the routine returns the number of failed login authentication attempts since last successful login authentication.
When an error occurs, is set and a negative error code is returned. The error code returned may be the same as or it may be an extended
error code defined in
Diagnostics
On error return may be set to one of the following values:
[EPERM] Either the password is incorrect, the password is expired, the specified line needs to be secure and is not, or the
account is disabled and a login authentication is required.
[EINVAL] No authentication information for user.
[ENOSYS] Security subsystem not configured correctly.
[EACCES] Process does not have read access to the necessary information.
On error return the return value may be the same as or, if errno is [EPERM], it may be one of the following additional values defined in
[A_EBADPASS] The supplied password was incorrect.
[A_ESOFTEXP] The accounts password has expired recently.
[A_EHARDEXP] The accounts password expired quite some time ago.
[A_ENOLOGIN] The account is not enabled.
[A_EOPENLINE] The account requires a secure line and the specified line was not marked that way in
Files
Environment
If the system is operating in the BSD security level, the password expiration, login fail count, and account disabling features are not
available (and therefore are not used in authentication computations).
See Also
getauthuid(3), getpwent(3), auth(5), passwd(5yp), ttys(5)
authenticate_user(3x)