mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
ssh: New application to manage SSH server
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
2e55acb465
commit
07c062aef3
6 files changed
+105
-3
No files matched your search
@@ -28,12 +28,16 @@ import stat
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from plinth import action_utils
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
"""Return parsed command line arguments as dictionary."""
|
||||
parser = argparse.ArgumentParser()
|
||||
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')
|
||||
|
||||
subparsers.add_parser('setup', help='Setup SSH server')
|
||||
|
||||
get_keys = subparsers.add_parser('get-keys',
|
||||
help='Get SSH authorized keys')
|
||||
get_keys.add_argument('--username')
|
||||
@@ -47,6 +51,11 @@ def parse_arguments():
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def subcommand_setup(arguments):
|
||||
"""Setup Open SSH server."""
|
||||
action_utils.dpkg_reconfigure('openssh-server', {})
|
||||
|
||||
|
||||
def get_user_homedir(username):
|
||||
"""Return the home dir of a user by looking up in password database."""
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user