Skip to content

Commit

Permalink
Improvement
Browse files Browse the repository at this point in the history
- Add Full access for username of windows
  • Loading branch information
rolldone committed Jul 15, 2022
1 parent cfc1664 commit ea503de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/directaccess/compute/DirectAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const DirectAccess = BaseModel.extend<Omit<DirectAccessInterface, 'model'>>({
} else { }
if (os.platform() == "win32") {
child_process.execSync(`Icacls "${_direct_access.ssh_configs[a].IdentityFile}" /Inheritance:r`)
child_process.execSync(`Icacls "${_direct_access.ssh_configs[a].IdentityFile}" /Grant:r "%Username%":"(R)"`)
child_process.execSync(`Icacls "${_direct_access.ssh_configs[a].IdentityFile}" /Grant:r "%username%":"(F)"`)
// Source : https://stackoverflow.com/questions/2928738/how-to-grant-permission-to-users-for-a-directory-using-command-line-in-windows
}
this._ssh_config.append(_direct_access.ssh_configs[a]);
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/init/compute/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ const Config = BaseModel.extend<ConfigInterface>({
let hasPasspharse = await this._hasPassphrase(this._config.privateKey);
if (os.platform() == "win32") {
execSync(`Icacls "${this._config.privateKey}" /Inheritance:r`)
execSync(`Icacls "${this._config.privateKey}" /Grant:r "%Username%":"(R)"`)
execSync(`Icacls "${this._config.privateKey}" /Grant:r "%username%":"(F)"`)
// Source :: https://stackoverflow.com/questions/2928738/how-to-grant-permission-to-users-for-a-directory-using-command-line-in-windows
}else{
chmodSync(this._config.privateKey, 0o400);
}
Expand Down

0 comments on commit ea503de

Please sign in to comment.