Hi,
I have a requirement to add an SSH login banner to all our Centos boxes. As there are quite a few I would like to script the process. I have what I believe are all the pieces but I am stumbling putting them all together. Ideally what I would like to do is:
Loop though a list of server names
Connect to each and upload a small script (currently I am testing with LFTP as I can pass the password also)
Execute the script
Exit
I have a shell script to cat the text I need into the /etc/issue.net file and the subsequent /etc/ssh/sshd_config file and restart the sshd daemon. I just need to get them uploaded and executed.
I welcome any suggestions for a simpler way of doing this.
Batch upload script and execute
Re: Batch upload script and execute
So two things.
1) Do you need to restart sshd? I thought issue.net was "obeyed" by sshd anyway?
2) There is an argument you can present to ssh which says "just execute the following". I think it's -C, but you can check in the ssh manual (man ssh)
Alternatively, use something (cool) like Anisble....
1) Do you need to restart sshd? I thought issue.net was "obeyed" by sshd anyway?
2) There is an argument you can present to ssh which says "just execute the following". I think it's -C, but you can check in the ssh manual (man ssh)
Alternatively, use something (cool) like Anisble....
Re: Batch upload script and execute
Aks,
Thanks for the reply. I'm not sure about the need to restart sshd after edititing the issue.net file so I will test to see.
With regards the -c switch that is for compression I believe I'm ssh. I have managed to put to get her a comma d that works using LFTP which comprises SSH aft and the mput command.
Thanks again for the input.
Thanks for the reply. I'm not sure about the need to restart sshd after edititing the issue.net file so I will test to see.
With regards the -c switch that is for compression I believe I'm ssh. I have managed to put to get her a comma d that works using LFTP which comprises SSH aft and the mput command.
Thanks again for the input.
Re: Batch upload script and execute
It sounds like what you really need is to investigate one of the many configuration management packages like puppet/salt/ansible/chef/cfengine.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke