AIX pam ssh/sshd configuration not allowing sed or awk


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AIX pam ssh/sshd configuration not allowing sed or awk
# 1  
Old 01-23-2013
AIX pam ssh/sshd configuration not allowing sed or awk

This is a weird problem. Following is my code.

Code:
/opt/quest/bin/vastool configure pam sshd
/opt/quest/bin/vastool configure pam ssh

cat /etc/pam.conf | \
awk '$1=="ssh"||$1=="sshd"||$1=="emagent"{sub("prohibit","aix",$NF);}1' OFS='\t' > /etc/pam.conf

cat /etc/ssh/sshd_config | \
sed -e 's/^UsePAM no/UsePAM yes/' > /etc/ssh/sshd_config

If I remove below from the script, both awk and sed are working accordingly.

Code:
/opt/quest/bin/vastool configure pam sshd
/opt/quest/bin/vastool configure pam ssh

But if I execute them together, those files, which are supposed to change are becoming empty SmilieSmilie

Is there any relation between pam ssh configuration and sed/awk? I totally not getting the point behind that.
# 2  
Old 01-23-2013
I wonder if vastool is running something in the background and the .conf files havent been written yet when your sed/awk runs. Try putting a wait or sleep 10 before you process the .conf files.
# 3  
Old 01-23-2013
I tried that, but still it is doing the same. SmilieSmilieSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SOCKS proxy & PAM configuration exposure

I've got a problem with a proxy configuration. We have an LDAP group that lists all users who are authorised to use the proxy to FTP (usually Filezilla) out to the world, and by implication those not in the group should be denied. My users are delighted that this has been enabled and those that... (9 Replies)
Discussion started by: rbatte1
9 Replies

2. AIX

Ssh not allowing NIS user to login

As I do a ssh <nis_user>@server1 from server2, ssh prompts for certificates (as expected the first time), then it prompts for the users password, as soon as I enter the password, I get a Connection to server1 closed by remote host, and connection to server1 closed. and I disconnect back to the... (3 Replies)
Discussion started by: mrmurdock
3 Replies

3. Solaris

pam sshd error

Hi I wanted to convert my pam libraries to 64 bit. so recently compiled my pam_banner and pam_wheel to 64 bit. I got the following error... sshd: dlsym failed pam_sm_authenticate:error ld.so.1 : sshd fatal: pam_sm_authenticate: can't find symbol thnaks (8 Replies)
Discussion started by: chinchao
8 Replies

4. Emergency UNIX and Linux Support

PAM? cannot login, ssh or su

look at this, as root user change passwd and su -: I cannot ssh in or rlogin either, (3 Replies)
Discussion started by: bigearsbilly
3 Replies

5. Solaris

LDAP, PAM or SSHD?

Hi, I´m trying to make Solaris authenticate users in AD. NTP is working, nsswitch.ldap is listed above, DNS is Ok and I made something different in pam.conf, krb5.conf and sshd_config (see above) nsswitch.ldap: passwd: files ldap group: files ldap hosts: files dns ipnodes: ... (0 Replies)
Discussion started by: mpcavalcanti
0 Replies

6. Red Hat

sshd started, but ssh/sftp/psftp not working

The OS is CenOS. The sshds is started, but ssh/sftp/psftp are not working with "time out" errors. # service sshd status openssh-daemon (pid 2894) is running... # tail /var/log/secure Feb 16 10:56:47 cenos userhelper: pam_timestamp(system-config-securitylevel:session): updated... (3 Replies)
Discussion started by: aixlover
3 Replies

7. Red Hat

PAM configuration: Kerberos authentication and NIS authorization problem

Hi, I've configured two linux boxes to authenticate against Windows Active Directory using Kerberos while retrieving authorization data (uids, gids ,,,)from NIS. The problem I ran into with my PAM configuration is that all authentication attempts succeed in order.i.e. if someone tried his... (0 Replies)
Discussion started by: geek.ksa
0 Replies

8. AIX

Problem starting sshd on AIX

I just installed SSH on an AIX machine: > lslpp -l openssh.base.server Fileset Level State Description ---------------------------------------------------------------------------- Path: /usr/lib/objrepos openssh.base.server 4.1.0.5301 COMMITTED Open... (1 Reply)
Discussion started by: outtacontrol
1 Replies

9. UNIX for Dummies Questions & Answers

reread pam configuration

Hi. i am on solaris. I have changed pam configuration. Do i need to let pam re-read its configuration again? If so, how can i do it? ps -ef | grep -i pam, returns no hits. Rgds (0 Replies)
Discussion started by: yls177
0 Replies

10. UNIX for Advanced & Expert Users

Pam configuration

I have suse (SLES 9) machine,I would like to know how to creat a PAM configure file for ldap authentication and loading it using a "config" argument to pam_ldap.so Thanks for your help (0 Replies)
Discussion started by: hassan1
0 Replies
Login or Register to Ask a Question