Script that modifies root level files

I run a decent size Solaris 8 network where we use host files and no DNS servers. I have a master host file to push out to all the machines (also would like to do system and services too) but, the only way I've ever been able to do it is buy telneting into the machine and ftping the file into place as root. I'd like to write a script to do this. Even if I have telnet into the box and su to root and then run. That would be a little better than the way it is now.

Anyone have any ideas on how I would get it to login to the remote machine with ftp? I can request it to ftp to x.x.x.x but then it will need a username and password which the script wont apply properly.

Any thoughts?

You should switch to dns. But if I had to automate this, I would have a dummy user called "hostfile" or something on one system. It would have the official hosts file in it's home directory. Each system would run a root cron job to get this file periodicly.

There are a lot of threads regarding automating ftp jobs. Use our search function to find them.

Thanks for your help. I notice that you are in Rockville MD. Do you happen to work for a company called Globalstar?

You might also want to look at rsync (there are numerous threads on this also) or cfengine. Also, if you have access to the Cluster cd, you can use the pkgadd to load SUNWcluster and use the ccp module to open up to 16 windows at once (to 16 systems) to update, monitor, or control servers.

Yeah, I have rsync and have been using it for a year now. I love it to death but, I can't do root level stuff with it. If I could I wouldn't have even bothered anyone with my questions.

What I'm going to do is run a little script I wrote as root from the target machine. The script will just pipe all the commands I want into ftp and show results verbosely.

I can't go to DNS. It's a long story but, we run a 24X7 operation and if a workstation goes down, we want all the others to be identical in design to be useable as direct swapouts for that failed machine. We also don't use DHCP every machine and LAN/WAN device is static and is listed in my host files. We are also on an isolated WAN that is non-terrestrial so we are nice and safe from outside issues.

So anyhow, it looks like I will get some performance out of this script. Just wish it could do su root too.:smiley:

Whoa!! :eek:

**cough**satellites**cough**:wink:

why not use NIS/NFS in this case?

sounds like you work for a bank of some sort.

Most non-terrestrial were believed to be more intelligent than terrestrials. I'm surprised you are asking us when we don't even have a cure for the common cold.

I want to use NIS but, I needed this right away. Since I have a script to use now, I'll be able to get by.

I plan to implement NIS in the future.

I work for a Satellite hosting firm. (we fly satellites for a bunch of companies)

This is true but, when I asked the WAN how to write the script it didn't answer me. How rude.