From: Nigel McNie Date: Mon, 14 May 2007 10:40:20 +0000 (+1200) Subject: Remove ssh known key in a user-generic fashion X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9ad1c18d2c8ffc83d411fd9e8652991b39927fa9;p=vserverctl.git Remove ssh known key in a user-generic fashion --- diff --git a/profile/base/remove-host b/profile/base/remove-host index 6d9d046..53cf618 100644 --- a/profile/base/remove-host +++ b/profile/base/remove-host @@ -2,6 +2,8 @@ grep -v "^${VSIPADDR}" /etc/hosts > /etc/hosts.new mv /etc/hosts.new /etc/hosts -grep -v "^${VSNAME}" /home/martyn/.ssh/known_hosts > /home/martyn/.ssh/known_hosts.new -chown martyn:martyn /home/martyn/.ssh/known_hosts.new -mv /home/martyn/.ssh/known_hosts.new /home/martyn/.ssh/known_hosts +USR=$PROFILEOPTION_username + +grep -v "^${VSNAME}" /home/${USR}/.ssh/known_hosts > /home/${USR}/.ssh/known_hosts.new +chown ${USR}:${USR} /home/${USR}/.ssh/known_hosts.new +mv /home/${USR}/.ssh/known_hosts.new /home/${USR}/.ssh/known_hosts