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:
Sunil Mohan Adapa authored and James Valleroy committed 2017-09-01 20:03:58 -04:00
1 parent 2e55acb465
commit 07c062aef3
6 files changed
+105 -3

No files matched your search

+9
View File
@@ -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: