hostname modification and port test before connecting on ssh