diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-05-30 17:57:01 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-05-30 17:57:01 +0000 |
commit | e4783dd9468a755f843a9db5235e386446a63e26 (patch) | |
tree | e0b778cbbdd9e3e43c4a9240a1d8ed6885d42a7b | |
parent | 9238bb10b5171e29951456e8fe46e6d595b0601b (diff) |
rtadm: create: remove old entry from known_hosts
Remove the entry for the localhost + the port we may connect to when
we create a new connection tarball.
Only works if known_hosts file is not hashed.
git-svn-id: svn+ssh://xorcom/home/svn/debs/components/rapid-tunneling@10611 283159da-0705-0410-b60c-f2062b4bb6ad
-rwxr-xr-x | rtadm | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -42,6 +42,10 @@ create() tarball="$HOME/tar/remote-access-$COMMENT.tar.gz" tar -czf $tarball -C ~/tmp basename host key port tunnelport user --owner root --group root mkdir -m 700 -p ~/.ssh + # Remove conflicting entries fron a non-hashed known_hosts file: + if [ -r $HOME/.ssh/known_hosts ]; then + sed -i -e "/^\[localhost\]:$PORT /d" $HOME/.ssh/known_hosts + fi umask 022 cat ~/tmp/key.pub >> ~/.ssh/authorized_keys |