mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 21:03:47 +00:00
Merge commit from fork
This commit is contained in:
@@ -87,6 +87,10 @@ async function deploySSHKeyToHost(
|
||||
}
|
||||
|
||||
const keyPattern = keyParts[1];
|
||||
if (!/^[A-Za-z0-9+/]+={0,2}$/.test(keyPattern)) {
|
||||
clearTimeout(checkTimeout);
|
||||
return rejectCheck(new Error("Invalid public key data"));
|
||||
}
|
||||
|
||||
conn.exec(
|
||||
`if [ -f ~/.ssh/authorized_keys ]; then grep -F "${keyPattern}" ~/.ssh/authorized_keys >/dev/null 2>&1; echo $?; else echo 1; fi`,
|
||||
@@ -192,6 +196,10 @@ async function deploySSHKeyToHost(
|
||||
}
|
||||
|
||||
const keyPattern = keyParts[1];
|
||||
if (!/^[A-Za-z0-9+/]+={0,2}$/.test(keyPattern)) {
|
||||
clearTimeout(verifyTimeout);
|
||||
return rejectVerify(new Error("Invalid public key data"));
|
||||
}
|
||||
conn.exec(
|
||||
`grep -F "${keyPattern}" ~/.ssh/authorized_keys >/dev/null 2>&1; echo $?`,
|
||||
(err, stream) => {
|
||||
|
||||
Reference in New Issue
Block a user