Help with script to create users from database query
This is what I have done so far. But obviously it still does not work.
I'm trying to create users based on information stored in a database. At the moment I'm just concentrating on creating users. But would like to add passwords as well. Anybody able to point me in the right direction
EDIT: I'm very new to bash scripting as well. Hence why I'm struggling.
Hi all, working on script to create a user acct on all our servers.
for i in `cat $host_file`; do
ssh $i /usr/bin/sudo /usr/bin/mkuser id='bpadm' gecos='NetBackup Admin' 2>&1 >> $log
done
error i get is: 3004-692 Error changing "id" to "bpadm" : Value is invalid.
I have tried this in... (1 Reply)
Hello everyone,
Not sure if this is the right place, but OS X isn't your standard Unix, so I figured here would be best. I am looking at creating a script that will be interactive that admins can run to create users.
Now, 10.4 uses netinfo database and netinfo manager to handle it's users. ... (3 Replies)
I am coding shell script.
I need to connect to different databases like DB2, Oracle and Sybase.
I would then need to query tables where it has all the groups, users for that database.
I would also need who has what kind of permissions.
EG: I know for DB2 some TABAUTH table needs to be... (0 Replies)
Hi, i have the following:
db="create database xxx;GRANT ALL PRIVILEGES ON xxx.* TO user@localhost IDENTIFIED BY 'password';FLUSH PRIVILEGES;quit;"
mysql -u root -p$mysql_pass -e "$db"
I don't understand why this is failing, it works fine when run from cmd but when is run in a bash script,... (1 Reply)
I remote to many DMZ boxes every day to run batch file that allows me to create users. I create users in 17 DMZ boxes every day which takes a lot of my time.
Is there any script that would do this job from my local computer?
Thank you for your help! (3 Replies)
I need to run a SQL select query in Oracle database and have to capture the list of retrieved records in shell script. Also i would like to modify the query for certain condition and need to fetch it again. How can i do this?
Is there a way to have a persistent connection to oracle database... (9 Replies)
I've been sent the following script to finish. It's supposed to connect to an oracle database, query it, and send an email if the query result value is one or more. Currently it isn't connecting properly, just giving the following error:
ERROR: ORA-01017: invalid username/password; logon denied... (2 Replies)
Hi.
I have two text files(tables) which include some information and I want to make some query codes using them.
First of all, I want to create bash script that read this two tables, create/open database and insert data from files into database.
#!/bin/bash
while read line; do
... (1 Reply)
Hello ,
I am new in this forum and need your help as I am totally confused :confused:
I read a lot of threads and tried to search a lot but did not get the exact answer to my question.
I just want a simple (content wise may be long) shell script to create oracle database.
In detail:... (5 Replies)
Hi All,
I am new to scripting, i want to create one script in which i can add users from a text file, assign them a default password like 123456.
It should be like:
Username= $i (it should take users from text file one by one)
Password : 123456(default for every user) (1 Reply)
Discussion started by: prad_rocxx
1 Replies
LEARN ABOUT REDHAT
newusers
NEWUSERS(8) System Manager's Manual NEWUSERS(8)NAME
newusers - update and create new users in batch
SYNOPSIS
newusers [new_users]
DESCRIPTION
newusers reads a file of user name and cleartext password pairs and uses this information to update a group of existing users or to create
new users. Each line is in the same format as the standard password file (see passwd(5)) with the following exceptions.
pw_passwd This field will be encrypted and used as the new value of the encrypted password.
pw_age This field will be ignored for shadow passwords if the user already exists.
pw_gid This field may be the name of an existing group, in which case the named user will be added as a member. If a non-existent
numerical group is given, a new group will be created having this number.
pw_dir This field will be checked for existence as a directory and a new directory with the same name will be created if it does not
already exist. The ownership of the directory will be set to be that of the user being created or updated.
This command is intended to be used in a large system environment where many accounts are updated at a single time.
CAVEATS
The input file must be protected since it contains unencrypted passwords.
SEE ALSO passwd(1), useradd(8)AUTHOR
Julianne Frances Haugh (jockgrrl@ix.netcom.com)
NEWUSERS(8)