Use custom port for host scan
parent
164a3e861e
commit
a1e01b2fad
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,7 @@ const run = async () => {
|
|||
const { path: privateKeyPath } = getPrivateKeyPath(deployKeyName);
|
||||
// Update known hosts if ssh command is present to avoid prompt
|
||||
if (scriptBefore || scriptAfter) {
|
||||
updateKnownHosts(remoteHost);
|
||||
updateKnownHosts(remoteHost, remotePort);
|
||||
}
|
||||
// Check Script before
|
||||
if (scriptBefore) {
|
||||
|
|
|
@ -23,11 +23,11 @@ const addSshKey = (content, deployKeyName) => {
|
|||
console.log('✅ [SSH] key added to `.ssh` dir ', dir, filename);
|
||||
};
|
||||
|
||||
const updateKnownHosts = (host) => {
|
||||
const updateKnownHosts = (host, remotePort) => {
|
||||
const { knownHostsPath } = getPrivateKeyPath();
|
||||
console.log('[SSH] Adding host to `known_hosts` ....', host, knownHostsPath);
|
||||
try {
|
||||
execSync(`ssh-keyscan -H ${host} >> ${knownHostsPath}`, {
|
||||
execSync(`ssh-keyscan -p ${(remotePort || 22)} -H ${host} >> ${knownHostsPath}`, {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
} catch (error) {
|
||||
|
|
Loading…
Reference in New Issue