|
@ -3,11 +3,19 @@ import parseCommand from './parse'; |
|
|
import logger from '../utils/logger'; |
|
|
import logger from '../utils/logger'; |
|
|
|
|
|
|
|
|
export default function sshOptions( |
|
|
export default function sshOptions( |
|
|
{ pass, path, command, host, port, auth, knownhosts }: { [s: string]: string }, |
|
|
{ |
|
|
|
|
|
pass, |
|
|
|
|
|
path, |
|
|
|
|
|
command, |
|
|
|
|
|
host, |
|
|
|
|
|
port, |
|
|
|
|
|
auth, |
|
|
|
|
|
knownhosts, |
|
|
|
|
|
}: { [s: string]: string }, |
|
|
key?: string |
|
|
key?: string |
|
|
): string[] { |
|
|
): string[] { |
|
|
const cmd = parseCommand(command, path); |
|
|
const cmd = parseCommand(command, path); |
|
|
const hostChecking = (knownhosts !== '/dev/null') ? 'yes' : 'no' |
|
|
const hostChecking = knownhosts !== '/dev/null' ? 'yes' : 'no'; |
|
|
const sshRemoteOptsBase = [ |
|
|
const sshRemoteOptsBase = [ |
|
|
'ssh', |
|
|
'ssh', |
|
|
host, |
|
|
host, |
|
@ -18,7 +26,7 @@ export default function sshOptions( |
|
|
`PreferredAuthentications=${auth}`, |
|
|
`PreferredAuthentications=${auth}`, |
|
|
'-o', |
|
|
'-o', |
|
|
`UserKnownHostsFile=${knownhosts}`, |
|
|
`UserKnownHostsFile=${knownhosts}`, |
|
|
'-o', |
|
|
'-o', |
|
|
`StrictHostKeyChecking=${hostChecking}`, |
|
|
`StrictHostKeyChecking=${hostChecking}`, |
|
|
]; |
|
|
]; |
|
|
logger.info(`Authentication Type: ${auth}`); |
|
|
logger.info(`Authentication Type: ${auth}`); |
|
|