Fix SSH known_hosts noise — add UserKnownHostsFile=/dev/null to all SSH calls
/root/.ssh is mounted read-only in the management container, causing stderr noise on every SSH connection. Routing to /dev/null avoids the write attempt. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
caf81d5f39
commit
cc5fc99242
1 changed files with 3 additions and 0 deletions
|
|
@ -111,6 +111,7 @@ async function sshGet(host, cmdArgs) {
|
||||||
const { stdout } = await spawnAsync('ssh', [
|
const { stdout } = await spawnAsync('ssh', [
|
||||||
'-i', SSH_KEY,
|
'-i', SSH_KEY,
|
||||||
'-o', 'StrictHostKeyChecking=no',
|
'-o', 'StrictHostKeyChecking=no',
|
||||||
|
'-o', 'UserKnownHostsFile=/dev/null',
|
||||||
'-o', 'ConnectTimeout=2',
|
'-o', 'ConnectTimeout=2',
|
||||||
`root@${host}`,
|
`root@${host}`,
|
||||||
...cmdArgs,
|
...cmdArgs,
|
||||||
|
|
@ -126,6 +127,7 @@ async function sshExec(host, command) {
|
||||||
const child = spawn('ssh', [
|
const child = spawn('ssh', [
|
||||||
'-i', SSH_KEY,
|
'-i', SSH_KEY,
|
||||||
'-o', 'StrictHostKeyChecking=no',
|
'-o', 'StrictHostKeyChecking=no',
|
||||||
|
'-o', 'UserKnownHostsFile=/dev/null',
|
||||||
'-o', 'ConnectTimeout=5',
|
'-o', 'ConnectTimeout=5',
|
||||||
`root@${host}`,
|
`root@${host}`,
|
||||||
'sh', '-c', command,
|
'sh', '-c', command,
|
||||||
|
|
@ -202,6 +204,7 @@ async function deploy(target, repoName) {
|
||||||
const { stdout } = await spawnAsync('ssh', [
|
const { stdout } = await spawnAsync('ssh', [
|
||||||
'-i', SSH_KEY,
|
'-i', SSH_KEY,
|
||||||
'-o', 'StrictHostKeyChecking=no',
|
'-o', 'StrictHostKeyChecking=no',
|
||||||
|
'-o', 'UserKnownHostsFile=/dev/null',
|
||||||
`root@${target.host}`,
|
`root@${target.host}`,
|
||||||
'sh', '-c', remoteCmd,
|
'sh', '-c', remoteCmd,
|
||||||
], { timeout: 300_000 })
|
], { timeout: 300_000 })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue