This article explains why a local Junos user may be unable to access shell mode using the start shell command, while the root user can access shell mode successfully.
In Junos OS, local user permissions are controlled by the login class assigned to the user under system login. The start shell command requires the assigned login class to include the shell or maintenance permission.
The recommended minimum permission for allowing shell access is shell. The maintenance permission also allows shell access, but it provides broader system maintenance privileges and should be used only when required.
This behavior is expected when the local user belongs to a login class that does not include the required shell access permission.
Example:
user@switch> start shell
^
syntax error
root@switch> start shell
%
user@switch> show configuration system login user <username>
user@switch> show configuration system login class <class-name>
user@switch> configure
user@switch# set system login class shell-access permissions [ view shell ]
user@switch# set system login user <username> class shell-access
user@switch# commit
user@switch> show cli authorization
user@switch# set system login class maintenance-access permissions [ view maintenance ]
user@switch# set system login user <username> class maintenance-access
user@switch# set system login class <class-name> deny-commands "^start shell.*"
Further information listed here
> User Access Privileges | Junos OS | Juniper Networks |
using with regex
> class (Defining Login Classes) | Junos OS | Juniper Networks