[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ssh-keygen & other things
From: |
Sami J. Mäkinen |
Subject: |
Re: ssh-keygen & other things |
Date: |
Mon, 13 Sep 2004 11:58:09 +0300 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 |
Thomas Glanzmann wrote:
I want to run ssh-keygen if /root/.ssh/id_dsa.pub doesn't exist.
use the startup scripts of your distributor, if they don't support that,
fix them.
Often, it might be a bad idea to tamper with init scripts
provided by your distributor/vendor. Your fixed script might be
overwritten with a update, for example. It is always a good idea
to make a copy of your own, like this on a red hat system:
cd /etc/init.d
cp sshd sshd.my
vi sshd.my
chkconfig --del sshd
chkconfig --add sshd.my
(this example was stupid because there is really nothing
wrong with sshd init script provided by red hat)
...or run a shellcommand from cfengine to achieve this, like
"/bin/sh -c '[ -f /root/.ssh/id_dsa.pub ] || ssh-keygen blaa blaa'"
Even though cfengine is good and ver useful, you should still remember
that simple sh onliners are often the most straightforward
and readable way to do certain things.
--
-- sjm
"Pirättäkää. Nakkeletta nuallen rassukoollen peräkoijasta
jokuja napollisia opaalia." - Junttapurin maharatsa