# How to disable Confd CLI access for all users and specific users

**URL:** https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662
**Category:** General
**Created:** [May 19, 2021, 5:55pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662 "2021-05-19T17:55:32Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![venkonan](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@venkonan](https://dmap-community.ductus.global/u/venkonan)
#### Post date: [May 19, 2021, 5:55pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/1 "2021-05-19T17:55:32Z")

</div>

Hi,

Can you please let me know how to disable access to confd CLI for all users and specific users.

Thanks,  
-Venkat

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [May 19, 2021, 6:32pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/2 "2021-05-19T18:32:21Z")

</div>

Hi,

See ConfD UG Chapter “The AAA infrastructure”, subchapter “Group Membership” and “Authorization”.  
In an nutshell you tie the users to a NACM group, then you associate NACM rules with the group. The NACM rules have a “context” setting that you set to for example “cli” for your deny/premitt rules.

Regards

---

<div class="post-metadata">

### Author: ![venkonan](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@venkonan](https://dmap-community.ductus.global/u/venkonan)
#### Post date: [May 20, 2021, 6:58pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/3 "2021-05-20T18:58:09Z")

</div>

Thank you.  
Other than NACM rules, do we have other way to disable confd cli access in a product? Customers will use netconf and within product, we use MAAPI API. So we are planning to disable confd cli access.

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [May 20, 2021, 9:01pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/4 "2021-05-20T21:01:06Z")

</div>

To disable the CLI for all users in your confd.conf file:

```xml
<cli>
  <enabled>false</enabled>
</cli>

```

---

<div class="post-metadata">

### Author: ![venkonan](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@venkonan](https://dmap-community.ductus.global/u/venkonan)
#### Post date: [May 21, 2021, 6:35pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/5 "2021-05-21T18:35:17Z")

</div>

I tried this already, but still I’m able to login. Here are my configs.

```auto
<cli>
    <restrictedFileAccess>true</restrictedFileAccess>
    <ssh>
      <enabled>false</enabled>
      <ip>0.0.0.0</ip>
      <port>2024</port>
    </ssh>
    <auditLogMode>denied</auditLogMode>
  </cli>

```

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [May 21, 2021, 7:48pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/6 "2021-05-21T19:48:42Z")

</div>

Try adding an enabled false tag value as I described. E.g.:

```auto
<cli>
  <enabled>false</enabled>
  <restrictedFileAccess>true</restrictedFileAccess>
  <ssh>
    <enabled>false</enabled>
    <ip>0.0.0.0</ip>
    <port>2024</port>
  </ssh>
  <auditLogMode>denied</auditLogMode>
</cli>

```

---

<div class="post-metadata">

### Author: ![venkonan](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@venkonan](https://dmap-community.ductus.global/u/venkonan)
#### Post date: [May 21, 2021, 9:05pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/7 "2021-05-21T21:05:21Z")

</div>

This also doesn’t help. ssh admin@localhost -p 2024 login works.  
am I missing anything here?

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [May 21, 2021, 10:08pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/8 "2021-05-21T22:08:28Z")

</div>

If yiou have enabled dynamic configuration, i.e. your confd.conf has this tag value set: `<runtimeReconfiguration>namespace</runtimeReconfiguration>`  
,Then you need to have the same config to disable the CLI in your “confd\_dyncfg\_init.xml” file.

---

<div class="post-metadata">

### Author: ![venkonan](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@venkonan](https://dmap-community.ductus.global/u/venkonan)
#### Post date: [June 1, 2021, 8:19pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/9 "2021-06-01T20:19:46Z")

</div>

> [@cohult](#):
>
> confd\_dyncfg\_init.xml

We don’t have this config in our confd.conf file.

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [June 1, 2021, 9:17pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/10 "2021-06-01T21:17:53Z")

</div>

> [@venkonan](#):
>
> We don’t have this config in our confd.conf file.

Then it is magic or you missed something in my suggestions above

---

<div class="post-metadata">

### Author: ![ltrinh](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@ltrinh](https://dmap-community.ductus.global/u/ltrinh)
#### Post date: [June 1, 2021, 9:48pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/11 "2021-06-01T21:48:00Z")

</div>

I think you can also control this by sessionLimit in the confd.conf:

```
<sessionLimit>
  <context>cli</context>
  <maxSessions>0</maxSessions>
</sessionLimit>
```

---

<div class="post-metadata">

### Author: ![greg](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@greg](https://dmap-community.ductus.global/u/greg)
#### Post date: [June 2, 2021, 4:51pm UTC](https://dmap-community.ductus.global/t/how-to-disable-confd-cli-access-for-all-users-and-specific-users/3662/12 "2021-06-02T16:51:55Z")

</div>

Venkat,  
I tried Conny’s suggestion to disable the CLI in confd.conf and it works for me. I used intro/1-2-3-start-query-model and did the following:

Step 1: disable the CLI (not by default it is enabled and so this needs to be added to confd.conf)

```auto
  <cli>
    <enabled>false</enabled>
  </cli>

```

Step 2: try connecting via SSH, with the error being returned:

```auto
$ ssh admin@localhost -p 2024
ssh: connect to host localhost port 2024: Connection refused

```

Step 3: try connecting using confd\_cli, and even that will fail:

```auto
confd_cli --user=admin --groups=admin \
		--interactive || echo Exit
Failed to connect to server
Exit

```

So in this simple case, it works as you would expect. Check to make sure you are editing the right confd.conf file, that you aren’t using dynamic configuration, and that you have stopped and restarted ConfD after changing the configuration. You might also want to try this simple example just to verify to yourself that this disables the CLI.
