Password script sync


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Password script sync
# 1  
Old 12-09-2009
Password script sync

Hi all,

I am trying to create a simple password script but it seems not working well.
What I'm trying to do is to sync the yppasswd and smbpasswd. So I created this:

Code:
#!/bin/csh
echo ""
echo "Please enter old password: "
set OLDPASSWD = $<
echo "Please enter new password: "
set NEWPASSWD = $<
yppasswd << EOF
$OLDPASSWD
$NEWPASSWD
EOF
smbpasswd << EOF
$OLDPASSWD
$NEWPASSWD
EOF

But not luck enaf to make it works. Any expert can give me a clue?


Thanks...

Last edited by pludi; 12-09-2009 at 02:17 AM.. Reason: code tags, please...
# 2  
Old 12-09-2009
this wont work the way your doing it but here are a few suggestions

1) use sh/ksh/bash for scripting (not really relevant but good practice)
2) If possible don't use NIS - use LDAP and store your passwords in one place then there will be no need for this script.
3) configure SAMBA to authenticate against NIS with a PAM module. again - one password store.
4) just have the user run each command. it should not be that big of a deal as they don't change passwords that often.
# 3  
Old 12-10-2009
thanks frank.

i've been googling for some example on samba & nis sync password.. but only find how to sync with ldap env. the system here is using nis.

if you have any link you could share with me with an example is greatly appreciated.

thanks again frank.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies

2. Shell Programming and Scripting

SFTP prompting for password even though password is in script

Hi All, I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup. I am working on Solaris 10. Here is the code. #!/bin/ksh # sample automatic Sftp script to dump a file USER="user1" PASSWORD="pass1" HOST="host1" sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies

3. Shell Programming and Scripting

Make a password protected bash script resist/refuse “bash -x” when the password is given

I want to give my long scripts to customer. The customer must not be able to read the scripts even if he has the password. The following command locks and unlocks the script but the set +x is simply ignored. The code: read -p 'Script: ' S && C=$S.crypt H='eval "$((dd if=$0 bs=1 skip=//|gpg... (7 Replies)
Discussion started by: frad
7 Replies

4. Solaris

Sync script between two places

Hello Team, We would like to copy or sync a couple a zpool and all dataset inside between two datacenters one time per day, the structure and space are the same in both sides. We are consider to use rsync and a cron job. We would like to know what type of ports we have to open in the... (1 Reply)
Discussion started by: csierra
1 Replies

5. Shell Programming and Scripting

crontab using shell script to sync files.

Hi, I developed one shell script where it will sync the files using perforce, #!/bin/bash TERM=linux export TERM clear echo "" $PATH echo "" cd /u/userk/p4/p4_client/TES_DATE echo "" echo "Sync p4 " p4 sync echo "Executing for second time " p4 -u userk -p p4net:161 -c... (8 Replies)
Discussion started by: asak
8 Replies

6. Shell Programming and Scripting

Korn shell script to sync/move files that are not in use

Hello all. This may seem like a dumb/easy question but right now I have a little script I made that uses rsync to sync a directory that has files in it that may or may not be complete files. I want to come up with a better solution for this. What it is is I have a directory lets say /incomplete... (4 Replies)
Discussion started by: linuxn00b
4 Replies

7. UNIX for Dummies Questions & Answers

sync password

hi guys I have multiples linux servers Centos 5.3 the idea is to create a mechanism that when users change his password that new password will change on all linux boxes.... do you have any experience on this? I know there are scripts to change password for a user but mine is whenever a... (11 Replies)
Discussion started by: karlochacon
11 Replies

8. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

9. Solaris

Sync to Green vs. Separate Sync

Hi all....I have a Sun Ultra2 that I want to use with my PC monitor. I have purchased an adapter that does not work and I was told I need to change my video card setting (if I can) to Separate Sync.....my Monitor product number ends in 1343......I am running SunOS 5.7 ......anyone have any ideas? ... (0 Replies)
Discussion started by: psantinello
0 Replies

10. UNIX for Advanced & Expert Users

samba questions (password conversion to blowfish and is it wise to sync the useraccou

i stumbled upon something that gave some nice instructions on how to convert FreeBSD passwords from md5 to blowfish. it was simple and straight forward and it worked. i'm running samba on the machine. now i know the tutorial i was following had something where a user's samba and machine... (1 Reply)
Discussion started by: xyyz
1 Replies
Login or Register to Ask a Question