06-10-2005
Yes. If you want to make this requirement with one script then proper setup has to be done as,
script running machine --> all other machines
which will not need password for ssh authentication. If you don't want to do this, then you have to give password for every authentication.
username="test"
group="group"
hostfile=./hostfile.log
while read server; do
ssh $server "useradd -g $group $username"
done < $hostfile
./hostfile.log will contain all remote server name.
hth.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi folks. I am writing a ksh ftp script. The problem is, I need to transfer the files to several different servers. Is there a way to close a connection and move on to the next in one script or do I need to write a separate script for each one?
Thanks,
kristy (2 Replies)
Discussion started by: kristy
2 Replies
2. Shell Programming and Scripting
good day. i jsut wanted to know what is the best script or the best way changing a lot of Ip's in all servers. Do you have any idea? im using awk to change IP,what if, you have lots of servers. You need to change it one by one? It will take time to change it manually. (2 Replies)
Discussion started by: kenshinhimura
2 Replies
3. Shell Programming and Scripting
I am trying to write a script to change passwords for the same user on multiple servers.
My environment runs purely ssh / scp not rsh / rcp and therefore coping using rcp is not an option.
I have been playing with expect to perform tasks but think there must be a better way.
Has anyone got... (7 Replies)
Discussion started by: stolz
7 Replies
4. UNIX for Advanced & Expert Users
Hi All,
I need help , Regarding the keyword search in multiple servers at a time . we are desiging a search website . we have a multiple servers and each of the server have 3 instances having Unix compressed files.Our requirement was we need to search the particular key word for eg. we need to... (7 Replies)
Discussion started by: prasad00124
7 Replies
5. UNIX for Dummies Questions & Answers
hi all
i am new to solaris
how to add a user to multiple(secondary) groups.
user :anna
Groups : delhi ,mumbai,pune
i need like this in cat /etc/group
delhi::anna
mumbai::anna
pune::anna
i tried using
usermod -a -G hyd anna
that does int work
how to delete user from group... (3 Replies)
Discussion started by: kalyankalyan
3 Replies
6. Shell Programming and Scripting
Need help in creating a user with passord in mulptiple solaris servers using a script.. (0 Replies)
Discussion started by: ningy
0 Replies
7. Shell Programming and Scripting
Hi,
I am running a shell script from a central server to multiple remote servers using the following code:
application_check()
{
# Linux/UNIX box with ssh key based login
SERVERS=`cat /tmp/server-details`
# SSH User name
USR="user"
# create new file
> /tmp/abc.log
# connect... (2 Replies)
Discussion started by: mystition
2 Replies
8. Shell Programming and Scripting
Hi Experts,
I am new to scripting. We have around 400 Linux servers in our environment. I want to add a new user to a perticular group on all the servers using SSH.
Requirements:
1) Need to take the server names from a text file.
2) Login into each server and check whether perticular... (1 Reply)
Discussion started by: Satya1983
1 Replies
9. Shell Programming and Scripting
Hello All,
The servers in question are AIX/Unix servers. I was hoping to find a scripting solution where I could use one server as a jump server and run a script that would check each server for a user account (the source file for the user accounts would be a text file or csv file) , and delete... (4 Replies)
Discussion started by: k45bryant
4 Replies
10. UNIX for Beginners Questions & Answers
Hi ,
Can any please help the below requirement on all multiple servers and multiple dbs.
update configuration set value='yes' ;1)
the above statement apply on 31 Databases at a time on different Ip address
eg : 10.104.1.12 (unix ip address )
the above ip box contains 4 db's eg : db... (2 Replies)
Discussion started by: venkat918
2 Replies
GFREP(1) GFREP(1)
NAME
gfrep - replicate Gfarm files
SYNOPSIS
gfrep [ -mnqvx ] [ -S source-domainname ] [ -D destination-domainname ] [ -h source-hostfile ] [ -H destination-hostfile ] [ -N num-of-
replicas ] [ -j num-of-threads ] path ...
DESCRIPTION
gfrep creates specified number of replicas of Gfarm files specified by the path to specified set of destination hosts. When set of source
hosts are specified, only files stored on the set of source hosts are replicated. A set of hosts can be specified by a domain name and/or
a host file. When both a domain name and a host file are specified, a set of hosts is determined by both conditions.
If the path parameter is a directory, files under the directory will be copied recursively.
OPTIONS
-S source-domainname
Specifies the domain name of source filesystem nodes from which replicas will be copied.
-D destination-domainname
Specifies the domain name of destination filesystem nodes to which replicas will be copied.
If neither this nor the -H option is specified, replicas may be copied to any available host.
-h source-hostfile
Specifies a file which describes hostnames of source filesystem nodes from which the replica will be made. The source-hostfile con-
sists of a filesystem node name on each line.
if ``-'' is specified, standard input is used to read the host list.
-H destination-hostfile
Specifies a file which describes hostnames of destination filesystem nodes on which the replica will be made. The destination-host-
file consists of a filesystem node name on each line.
if ``-'' is specified, standard input is used to read the host list.
-N num-of-replicas
Specifies the required number of file replicas, counting already existing ones. If there are a sufficient number of replicas in the
destination hosts, neither any copying nor any removal will be done.
If this option is not specified, -N 1 is assumed.
-j num-of-threads
Specifies the number of threads to create file replicas simultaneously. This option is only available when compiled by an OpenMP C
compiler. By default, it will be the smallest among the number of total files, the number of source hosts, and the number of desti-
nation hosts.
-m Lets gfrep command do a migrate/move, instead of doing replication.
-x Removes file replicas when a set of destination nodes has more file replicas than specified.
-n Displays files to be replicated, but does nothing.
-q Suppresses non-error messages.
-v Displays verbose output.
-? Displays a list of command options.
BUGS
A source host is not always selected within a set of source hosts.
Gfarm 09 November 2009 GFREP(1)