On top of what Scott already said, you seem to have DOS line terminators (^M / \r / 0x0D / <CR>) in your files, mayhap due to editing with an non-*nix tool.
What is your OS and editor?
Instead of using three command substitutions for the variable assignments, how about
assuming - as you do - the data file has one line only?
Hi All, :)
I have configure openldap but when I test this its show me a massage that "Invalid Creedientials". I search for the slove at Google, Yahoo but I did not find any solution.
Plz help me. :cool: (3 Replies)
Dears
i am going to write a shell script to do some administration jobs and automate them , but i need to access remote servers through telnet so my question is how to pass the required credentials to telnet through shell script or can i use a file and redirect the standard input to be from that... (3 Replies)
KSH - Unix -AIX - db2
**************
Get the input from the user say '123' (It varies)
Then i want to connect to a database say "D1"
then i want th extract from the database by giving "select * from tablename where input = '123'
I also want to connect to another database "D2"
then i... (3 Replies)
Hi,
I my unix we have one file that contains all the database credentials.
we are calling that file while connecting databse.
I need to hide that file....other user should not view that file.
How to do this. Please suggest me apart from permisstion(chmod) level suggestion.
Regards,... (3 Replies)
Hi,
I am using the following syntax to connect to an FTP server and paste the file.
Based on the value in the variable $Folder, i want to connect to different folders on the same server. The credential is different to access different folders. How to get the user name and password from a... (3 Replies)
Experts,
I login to a 3rd party and pull some valuable information with my credentials. I pass my credentials via --post-data in wget.
Now my Account is locked. I want my wget to alert that the Account is locked. How can i achieve this.
My idea is, get the Source page html from the... (2 Replies)
If I run the below code... it will login into the router and then changes to privilege mode and then stores the running configuration information to an array.
In this program, I have included the username and password .
In case the username and password is wrong.. it will re login for 2 times... (0 Replies)
Hi,
We usually switch user using the below command.
sudo su - user1
It then prompts for the password which we feed in.
I wish to pass both the username and the password in one go thus eliminating the prompt for the password.
I am using java standalone to connect to unix using... (11 Replies)
Hi,
I need to somehow pipe the password to a command and run some SQL, for example, something like echo $password | sqlplus -s system @query01.sql
To make it not so obvious, I decided to try out writing a small C program that basically just do echo $password. So now I just do x9.out | sqlplus... (8 Replies)
Hello all,
I need some help with a script I have been working on. I was wanting to know if it is possible to add authentication to it for each server it runs across? The credentials are all the same on each server.
This is what I am using so far and it seems to work. I am trying to avoid... (3 Replies)
Discussion started by: Smorgen
3 Replies
LEARN ABOUT PLAN9
pam_setcred
PAM_SETCRED(3) Linux-PAM Manual PAM_SETCRED(3)NAME
pam_setcred - establish / delete user credentials
SYNOPSIS
#include <security/pam_appl.h>
int pam_setcred(pam_handle_t *pamh, int flags);
DESCRIPTION
The pam_setcred function is used to establish, maintain and delete the credentials of a user. It should be called to set the credentials
after a user has been authenticated and before a session is opened for the user (with pam_open_session(3)). The credentials should be
deleted after the session has been closed (with pam_close_session(3)).
A credential is something that the user possesses. It is some property, such as a Kerberos ticket, or a supplementary group membership that
make up the uniqueness of a given user. On a Linux system the user's UID and GID's are credentials too. However, it has been decided that
these properties (along with the default supplementary groups of which the user is a member) are credentials that should be set directly by
the application and not by PAM. Such credentials should be established, by the application, prior to a call to this function. For example,
initgroups(2) (or equivalent) should have been performed.
Valid flags, any one of which, may be logically OR'd with PAM_SILENT, are:
PAM_ESTABLISH_CRED
Initialize the credentials for the user.
PAM_DELETE_CRED
Delete the user's credentials.
PAM_REINITIALIZE_CRED
Fully reinitialize the user's credentials.
PAM_REFRESH_CRED
Extend the lifetime of the existing credentials.
RETURN VALUES
PAM_BUF_ERR
Memory buffer error.
PAM_CRED_ERR
Failed to set user credentials.
PAM_CRED_EXPIRED
User credentials are expired.
PAM_CRED_UNAVAIL
Failed to retrieve user credentials.
PAM_SUCCESS
Data was successful stored.
PAM_SYSTEM_ERR
A NULL pointer was submitted as PAM handle, the function was called by a module or another system error occured.
PAM_USER_UNKNOWN
User is not known to an authentication module.
SEE ALSO pam_authenticate(3), pam_open_session(3), pam_close_session(3), pam_strerror(3)Linux-PAM Manual 06/04/2011 PAM_SETCRED(3)