Files
huishou/test-ssh.js
T
2026-07-27 13:46:06 +08:00

15 lines
498 B
JavaScript

const { execSync } = require('child_process');
try {
console.log('=== Testing SSH without host key checking ===');
const result = execSync('ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -T git@git.torchcloud.cn', {
stdio: ['inherit', 'inherit', 'inherit'],
timeout: 30000,
cwd: __dirname
});
console.log('=== SSH connection successful ===');
} catch (error) {
console.error('=== SSH connection failed ===');
console.error('Exit code:', error.status);
}