-------------------------------------------------
IMPORTANT NOTICE: The information in this email is confidential and may also be privileged.If you are not the intended recipient, any use or dissemination of the information and any disclosure or copying of this email is unauthorised and strictly prohibited. If you have received this email in error, please promptly inform us by reply email or telephone. You should also delete this email and destroy any hard copies produced.--
You received this message because you are subscribed to the Google Groups "klish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hello
We have solved this problem by sudo utility and NAMESPACEs.
The privileged mode (enable mode) is implemented in standard way (using su and executing new clish process). But "show running-config" command is defined in separate XML file in separate VIEW. Then this file is used by both privileged and unprivileged modes. The VIEW (with show running-config) is included to main VIEWs by NAMESPACE tag.
The "show running-config" command use sudo utility to get superuser privileges and so successfully connect to konfd daemon. The sudo utility has rich config file syntax to limit sudo operations by operations you want (execution of konf utility only for example).
Probably the ideal solution is to create additional unix socket with read-only access in konfd daemon. So everybody can read config but only privileged user can change config via another socket. But it's not implemented now. I think the sudo solution is rather good because we can use this mechanism for another information commands that need privileged access.
Hello,I am trying to restrict users access to configure mode, but i want the non-privileged user to still be able to run the "#show running-config" and see the output. I have tried this in several different ways, but I cannot make heads or tails of a way to achieve this result.First I tried putting a view restriction on the configure mode:
<COMMAND name="configure"help="Enter the configure view"access="root"/>
<COMMAND name="configure terminal"help="Configure from the terminal"view="configure-view"access="root"lock="true"/>
If I run clish as any other user, they cannot gain access to configure mode, but they also cannot see running config. They get this error:
localhost.localdomain#show running-configCannot write to the running-config.The error while request to the config daemon.
I have to run the daemon like this in order for the privilege levels to seem to work: