SSH by default using the Tcp22 port, in order to protect the Linux 22-side xxx break, we sometimes need to change the port of SSH, however, in the enterprise environment, the number of servers is huge, one can imagine the workload modification. The use of puppet can be a good solution to such problems, for operations and maintenance personnel to alleviate the burden of work.
The case topologies are as follows:
Puppetclient is the Linux server that needs to modify the SSH port
1.
1) puppetmaster should create the following directory, puppet run user puppet should be the owner of the directory
2)/etc/puppet/modules/ssh/manifests/configuration on each configuration file
Install.pp
Config.pp
Service.pp
Init.pp
3) configuration of/etc/puppet/modules/ssh/files/ssh/sshd_config (modify port)
4) Configuration of/ETC/PUPPET/MANIFESTS/NODES/SSH.PP
#添加两个SSH节点的主机名
5) Configuration of/ETC/PUPPET/MANIFESTS/SITE.PP
Complete the above configuration to restart the puppetmaster service
2, the configuration on each node
/etc/puppet/auth.conf
Add "Listen = True" at the end
/etc/puppet/puppet.conf
At the end, add "Allow ' Master IP address '"
Complete the above configuration restart Puppetclient service
3. Puppet command
Puppet kick hostname (Operation push on Master)
Puppet Agent-t (active pull on client)
Puppet bulk Modify SSH port-linux software distribution