Saturday, February 23, 2013

SSH Config files, and repo installs

In your .ssh folder, make a file called "config", put in it this information, change to your specs.

Host example.com
  Hostname example.com
  HostKeyAlias example
  Port 2222
  User linus






This is handy to have when you ssh into machines that have non standard ports, so with this you can now type: "ssh example" and it will insert your information that's needed for logging in. You still need the password, unless you setup keys. It works for scp as well. This is what I use it for.




Also today created a quick script for my rhel machines.


http://www.simontek.net/linux/iso/repoinstall.sh

# Created by Matthew M. Conley to add the epel, and el repo's to a build.
#
#!/bin/bash
if grep --quiet "[elrepo]" /etc/yum.repos.d/*; then
   echo "EL repo is installed"
else

rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
fi

if grep --quiet "[epel]" /etc/yum.repos.d/*; then
   echo "epel is installed"
else
rpm --import https://fedoraproject.org/keys
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
fi

 It checks to see if the el and epel repo's are installed, if not installs them. I tend to have to do this all the time, so figured just put it in a script. I still can't tell you how often on test builds that I didn't use a kickstart I have to type "sed -i 's/no/yes/' /etc/sysconfig/network-scripts/ifcfg-eth0" Which turns the ONBOOT=no to ONBOOT=yes in eth0 config file.

No comments: