diff --git a/src/yunohost/ssh.py b/src/yunohost/ssh.py index 428b70ea3..0e20737d0 100644 --- a/src/yunohost/ssh.py +++ b/src/yunohost/ssh.py @@ -151,8 +151,6 @@ def _get_user_for_ssh(username, attrs=None): "username": "root", "fullname": "", "mail": "", - "ssh_allowed": ssh_root_login_status()["PermitRootLogin"], - "shell": root_unix.pw_shell, "home_path": root_unix.pw_dir, } @@ -162,8 +160,6 @@ def _get_user_for_ssh(username, attrs=None): "username": "admin", "fullname": "", "mail": "", - "ssh_allowed": admin_unix.pw_shell.strip() != "/bin/false", - "shell": admin_unix.pw_shell, "home_path": admin_unix.pw_dir, } diff --git a/src/yunohost/tests/test_apps_arguments_parsing.py b/src/yunohost/tests/test_apps_arguments_parsing.py index 98dd280ff..95d1548ae 100644 --- a/src/yunohost/tests/test_apps_arguments_parsing.py +++ b/src/yunohost/tests/test_apps_arguments_parsing.py @@ -1206,7 +1206,6 @@ def test_parse_args_in_yunohost_format_user_empty(): "some_user": { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "p@ynh.local", "fullname": "the first name the last name", @@ -1232,7 +1231,6 @@ def test_parse_args_in_yunohost_format_user(): username: { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "p@ynh.local", "fullname": "the first name the last name", @@ -1261,7 +1259,6 @@ def test_parse_args_in_yunohost_format_user_two_users(): username: { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "p@ynh.local", "fullname": "the first name the last name", @@ -1269,7 +1266,6 @@ def test_parse_args_in_yunohost_format_user_two_users(): other_user: { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "z@ynh.local", "fullname": "john doe", @@ -1304,7 +1300,6 @@ def test_parse_args_in_yunohost_format_user_two_users_wrong_answer(): username: { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "p@ynh.local", "fullname": "the first name the last name", @@ -1312,7 +1307,6 @@ def test_parse_args_in_yunohost_format_user_two_users_wrong_answer(): other_user: { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "z@ynh.local", "fullname": "john doe", @@ -1339,7 +1333,6 @@ def test_parse_args_in_yunohost_format_user_two_users_no_default(): username: { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "p@ynh.local", "fullname": "the first name the last name", @@ -1347,7 +1340,6 @@ def test_parse_args_in_yunohost_format_user_two_users_no_default(): other_user: { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "z@ynh.local", "fullname": "john doe", @@ -1369,7 +1361,6 @@ def test_parse_args_in_yunohost_format_user_two_users_default_input(): username: { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "p@ynh.local", "fullname": "the first name the last name", @@ -1377,7 +1368,6 @@ def test_parse_args_in_yunohost_format_user_two_users_default_input(): other_user: { "ssh_allowed": False, "username": "some_user", - "shell": "/bin/false", "mailbox-quota": "0", "mail": "z@ynh.local", "fullname": "john doe", diff --git a/src/yunohost/user.py b/src/yunohost/user.py index 4098092e5..455c71139 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -53,7 +53,6 @@ def user_list(fields=None): "cn": "fullname", "mail": "mail", "maildrop": "mail-forward", - "loginShell": "shell", "homeDirectory": "home_path", "mailuserquota": "mailbox-quota", } @@ -69,7 +68,7 @@ def user_list(fields=None): else: raise YunohostError("field_invalid", attr) else: - attrs = ["uid", "cn", "mail", "mailuserquota", "loginShell"] + attrs = ["uid", "cn", "mail", "mailuserquota"] ldap = _get_ldap_interface() result = ldap.search( @@ -82,12 +81,6 @@ def user_list(fields=None): entry = {} for attr, values in user.items(): if values: - if attr == "loginShell": - if values[0].strip() == "/bin/false": - entry["ssh_allowed"] = False - else: - entry["ssh_allowed"] = True - entry[user_attrs[attr]] = values[0] uid = entry[user_attrs["uid"]] @@ -206,7 +199,7 @@ def user_create( "gidNumber": [uid], "uidNumber": [uid], "homeDirectory": ["/home/" + username], - "loginShell": ["/bin/false"], + "loginShell": ["/bin/bash"], } # If it is the first user, add some aliases