func ssh finished