Script to add .profile from one server to all other servers in the network


 
Thread Tools Search this Thread
Operating Systems AIX Script to add .profile from one server to all other servers in the network
# 1  
Old 02-22-2012
Script to add .profile from one server to all other servers in the network

Hi experts,

I am an AIX/Unix admin in my company. I have been asked by one user to distribute .profile from one server to all other servers in the network. This is what she has asked me:

"Is there a way for me to save and use one .profile that I have personalized with aliases for all my AIX/LINUX access?"
I was thinking of making a script to run on the host sever (with the .profile file) so that it copies the .profile to all other servers (AIX and Linux). Or is there a better way I can achieve that?

Thanks.

Last edited by zxmaus; 02-26-2012 at 08:59 AM..
# 2  
Old 02-22-2012
Well, gnu parallel can do it in parallel, but generally, unless you make all home dirs a mount of some common dir, you do N copies. It should be a one time deal, usually, but it can be scripted in case you want to move it.

The ssh command scp is nice for this. If you set up one ~/.ssh/* so 'ssh localhost pwd' works password free, and then scp -rp ~/.ssh that to all the other hosts, then you can scp password free, great for scripts. (Ironically, the lines added for localhost in known_hosts will fail elsewhere, but just remove them and it will make new ones.) Everywhere you copy your ~/.ssh, you will extend password-free ssh and scp (and even sftp if you must) access to all other such hosts. It generally needs to be copied even less often than the .profile file.
# 3  
Old 02-22-2012
Thanks. I got what you're trying to say here. But I am still struggling to script it down, i am new to it...
# 4  
Old 02-24-2012
Code:
for host in x y z
do
  scp -p .profile $host:.
done

while read host
do
  scp -p .profile $host:.
done <host_list_file

# 5  
Old 03-02-2012
Thanks i'll surely try it now..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Network Manager not setting correct DNS servers

Since a few weeks i use Ubuntu 16 on my laptop: # uname -a Linux xxxx 4.8.0-52-generic #55~16.04.1-Ubuntu SMP Fri Apr 28 14:36:29 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Because i want to use a custom name server i set the properties in the "Edit Connections" dialogue to the following: ... (2 Replies)
Discussion started by: bakunin
2 Replies

2. Shell Programming and Scripting

Bash Script to pull ipa server name on 500 servers

Hello All, I need help writing a bash script that will run on 500 LINUX servers and do the following: 1. Capture the ipa_server name from /etc/sssd/sssd.conf on a list of 500 servers in the ipahosts file. 2. Write to a file outputing only server name and IPA server name. Root ssh keys... (3 Replies)
Discussion started by: vtowntechy
3 Replies

3. IP Networking

Help with to check the tcp network connectivity between servers and hosts

ello, i am new to the networking side. I have a requirement to check the tcp network connectivity between server it's running on and the list of host's and ports combination. please help me where i am going wrong. my code: #!/bin/bash #read the file line by line cd "$1" cat... (17 Replies)
Discussion started by: sknovice
17 Replies

4. Shell Programming and Scripting

Help with shell script to check the tcp network connectivity between server

Hello, I have a requirement to check the tcp network connectivity between server it's running on and the list of host's and ports combination. i have written the below code but it doesn't work, but when i execute the nc command outside the script it works fine. please help me where i am... (8 Replies)
Discussion started by: sknovice
8 Replies

5. Red Hat

Need automation script executing on multiple servers from one server

I have a tar file uploaded in a FTP server and it needs to be deployed in some 300 linux machines in a path like /opt/oracle/scripts and untar the file. it needs to be executed with one shell script by executing on all the the servers. this tar needs to deployed by doing pbrun su - user.... (4 Replies)
Discussion started by: appoo4
4 Replies

6. UNIX for Dummies Questions & Answers

Need network info of servers

Hi, Need to Collect IP Details in the following format ServerName ; IPADDR1 ; NETMASK1 ; IPADDR2 ; NETMASK2 ; IPADDR3 ; NETMASK3 ; Could you please give me the suggesstions. Thanks (1 Reply)
Discussion started by: rajasekg
1 Replies

7. Shell Programming and Scripting

Script to add new users to a group on multiple servers using SSH

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

8. UNIX for Dummies Questions & Answers

tool scan my network and get all Unix servers

Hello, is there any tool where I can scan my netwrk and get all types of Unix servers? (2 Replies)
Discussion started by: fsmadi
2 Replies

9. IP Networking

how to cp between servers on diff network

Hi, how can i sftp or scp between 2 servers, when only i am able to ping to them. they are on different network 10.130.170.31 -- server 1 10.130.230.141 -- server 2 i need to transfer data files from 1 to 2. need your suggestions or help on these. Regards saha (4 Replies)
Discussion started by: saha
4 Replies

10. IP Networking

ssh server is attachable from local network not from another network

hello i have a ubuntu ssh server that i can acess from any of my comnputers but only if they are on the same wireless network as the server. i tested trhis my tehtehring my samsung blackjack to my windows partition and installing openssh to windows it works when windows is on the wireless but no... (1 Reply)
Discussion started by: old noob
1 Replies
Login or Register to Ask a Question