import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;
+import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import org.argeo.api.cms.CmsAuth;
import org.argeo.api.cms.CmsConstants;
import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.CmsSshd;
import org.argeo.api.cms.CmsState;
import org.argeo.cms.CmsDeployProperty;
-import org.argeo.cms.CmsSshd;
public class CmsSshServer implements CmsSshd {
private final static CmsLog log = CmsLog.getLog(CmsSshServer.class);
// start
sshd.start();
- log.debug(() -> "CMS SSH server started on port " + port + (host != null ? " of host " + host : ""));
+ log.info("# SSH " + (host != null ? host + ":" : "*:") + port);
} catch (IOException e) {
throw new RuntimeException("Cannot start SSH server on port " + port, e);
}
(PrivateKey) store.getKey(CmsConstants.NODE, keyStorePassword));
} catch (IOException | KeyStoreException | NoSuchProviderException | NoSuchAlgorithmException
| CertificateException | IllegalArgumentException | UnrecoverableKeyException e) {
- log.error("Cannot add node public key to SSH authorized keys", e);
+ if (log.isTraceEnabled())
+ log.warn("Cannot add node public key to SSH authorized keys", e);
+ else
+ log.warn("Cannot add node public key to SSH authorized keys: " + e);
return null;
}
this.cmsState = cmsState;
}
+ @Override
+ public InetSocketAddress getAddress() {
+ return new InetSocketAddress(host, port);
+ }
+
}