mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-09 12:21:16 +00:00
ssh: Advise use of 'balena login' if root authentication fails
Change-type: patch
This commit is contained in:
parent
7e4f4392e9
commit
cd17d79067
@ -299,7 +299,13 @@ export const findBestUsernameForDevice = _.memoize(
|
||||
const { getCachedUsername } = await import('./bootstrap');
|
||||
username = (await getCachedUsername())?.username;
|
||||
}
|
||||
return username || 'root';
|
||||
if (!username) {
|
||||
const { stripIndent } = await import('./lazy');
|
||||
throw new ExpectedError(stripIndent`
|
||||
SSH authentication failed for 'root@${hostname}'.
|
||||
Please login with 'balena login' for alternative authentication.`);
|
||||
}
|
||||
return username;
|
||||
},
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user