Recently took a new role for work that involved being handed a large number of new Linux servers that I have never logged into before. So I wrote this little script that would automatically add my ssh keys to the list of servers. Also, you will need to already have you ssh keys generated.
Enjoy 🙂 and you will need to...
Expect Scripts, Linux
In my environment there are some commands I need to run as “true root”, which means I have to login to the server as root… no su or sesu. We have all of our Unix/Linux servers locked down for root access via SSH, so every now and then I need to open root temporarily in order to login as root to run some commands. I got tired of manually editing sshd_config and restarting the service just to re-do every change I just made. Here is a couple of Perl one-liners that will do the job for me.
Linux, Perl Scripts