fix: set a root for the ssh verification.

This commit is contained in:
silver 2023-08-19 20:47:58 +01:00
parent 82d7ca48bb
commit 8bec5e87b5
3 changed files with 9 additions and 2 deletions

View file

@ -458,9 +458,10 @@ pub mod ssh {
return Ok(json!({"result": "error", "error": "Skynet email not permitted."}).into());
}
let config = &req.state().config;
// check if <root>/<user>/.ssh/authorized_keys exists
//let root = "/skynet_old";
let root = ".";
let root = &config.ssh_root;
let path = format!("{}/{}/.ssh/authorized_keys", root, user);
let mut keys = vec![];
if fs::read_to_string(&path).is_ok() {