10-05-2023 01:24 PM
Hi,
I want to save a cli output to a file, however, cli does not allow me to save to a directory other than where I starts the ncs_cli.
For example, if I am in /root and start ncs_cli and I want to save cli output
to /tmp:
[root@mtnj06 ~]# ncs_cli -u admin
admin@ncs> show configuration devices device lab7smf | save /tmp/xyz100
-------------------------------------------------------------^
syntax error: access denied
[error][2023-10-05 16:11:04]
I can only save it to the directory where I start the ncs_cli:
sm000x@ncs> show configuration devices device lab7smf | save xyz100
[ok][2023-10-05 16:11:38]
sm000x@ncs> exit
I probably did something wrong.
Does anyone have same issue?
THX
sm000x
Solved! Go to Solution.
11-23-2023 09:45 AM
11-24-2023 08:52 AM - edited 11-24-2023 10:01 AM
You can use, for example, the process status Linux command to determine if NSO was started from a non-root user. Example:
Started by the 'root' user:
ps -C ncs.smp uc
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 640 16.4 70.8 10351564 5697440 ? Ssl 09:33 70:51 ncs.smp
Started by the non-root 'admin' user:
# ps -C ncs.smp uc
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
admin 644 14.5 18.5 5604616 1495112 ? Ssl 07:53 11:36 ncs.smp
11-24-2023 09:44 AM - edited 11-26-2023 06:41 PM
Also, make sure you have 'restricted-file-access' in ncs.conf set to 'false'. However, be mindful of the implications where CLI users will be less restricted. See the ncs.conf(5) man page for details on the restricted-file-access setting.
<cli>
<enabled>true</enabled>
...
<restricted-file-access>false</restricted-file-access>
...
</cli>
Note that the default ncs.conf for an NSO system installation has restricted-file-access set to true.
11-25-2023 06:34 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide