Skip to content

Commit

Permalink
Add trivial SSH id files support
Browse files Browse the repository at this point in the history
  • Loading branch information
alxchk committed May 23, 2017
1 parent bff5bda commit 5433fbd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Linux/lazagne/config/homes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ def get(file=[], dir=[]):
if not files and not dirs and os.path.isdir(p):
yield p

def users(file=[], dir=[]):
files = file if (type(file) in (tuple, list)) else [file]
dirs = dir if (type(dir) in (tuple, list)) else [dir]

for pw in pwd.getpwall():
if files:
for file in files:
if os.path.isfile(os.path.join(pw.pw_dir, file)):
yield pw.pw_name, os.path.join(pw.pw_dir, file)

if dirs:
for dir in dirs:
if os.path.isdir(os.path.join(pw.pw_dir, dir)):
yield pw.pw_name, os.path.join(pw.pw_dir, dir)

if not files and not dirs and os.path.isdir(pw.pw_dir):
yield pw.pw_name, pw.pw_dir

def sessions(setenv=True):
visited = set()

Expand Down
1 change: 1 addition & 0 deletions Linux/lazagne/config/manageModules.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def get_modules():
Shadow(),
Aws(),
Docker(),
Ssh(),
SQLDeveloper(),
Squirrel(),
Wifi(),
Expand Down

0 comments on commit 5433fbd

Please sign in to comment.