# Special character \\ is rejected in confd

**URL:** https://dmap-community.ductus.global/t/special-character-is-rejected-in-confd/4687
**Category:** YANG
**Created:** [April 25, 2024, 7:51am UTC](https://dmap-community.ductus.global/t/special-character-is-rejected-in-confd/4687 "2024-04-25T07:51:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kramarat](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@kramarat](https://dmap-community.ductus.global/u/kramarat)
#### Post date: [April 25, 2024, 7:51am UTC](https://dmap-community.ductus.global/t/special-character-is-rejected-in-confd/4687/1 "2024-04-25T07:51:21Z")

</div>

Hi Team,

In the below example “pre-share key” of type string, the user enters the password which can have any characters including special character , but in the below case if the input contains \ then the CLI is rejected in CONFD.

Is there any tailf which can be added to allow special character like \ to be allowed in input.

CLI :

```plaintext
crypto ikev2 profile UNDERLAY
 authentication remote pre-share key 6 <str>

```

CONFD O/P :

```plaintext
Router(config-ikev2-profile)# authentication remote pre-share key 6 
GNf_IFDYSON\\\ObALONBeVLLDCR\cWb_LCOHKEMghcNQ^Y^`cGC[gZA`DAMMAFRAJ\ZJXH[\AF][^[eb`f\e^gVSaO`G]aZOEI_VFPhCeDMW]TZBWP]F
--------------------------------------------------------------------^
syntax error: "GNf_IFDYSON\ObALONBeVLLDCRcWb_LCOHKEMghcNQ^Y^`cGC[gZA`DAMMAFRAJZJXH[AF][^[eb`fVSaO`G]aZOEI_VFPhCeDMW]TZBWP]F" is an invalid value.
Router(config-ikev2-profile)#

```

---

<div class="post-metadata">

### Author: ![kramarat](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@kramarat](https://dmap-community.ductus.global/u/kramarat)
#### Post date: [April 30, 2024, 11:50am UTC](https://dmap-community.ductus.global/t/special-character-is-rejected-in-confd/4687/2 "2024-04-30T11:50:30Z")

</div>

Hi Team,

Appreciate some quick response on the same as it requires immediate attention.

Thanks,  
Karthik. R

---

<div class="post-metadata">

### Author: ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)
#### Post date: [May 1, 2024, 7:59am UTC](https://dmap-community.ductus.global/t/special-character-is-rejected-in-confd/4687/3 "2024-05-01T07:59:29Z")

</div>

Hello Karthik,

i think you just need to escape special characters in the password string similar to bash or other shells.

Try using double quotes before/after password and `\` slash-escape all the internal special chars…

e.g. for password: `abc\22a` try `"abc\\22a"`

---

<div class="post-metadata">

### Author: ![kramarat](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@kramarat](https://dmap-community.ductus.global/u/kramarat)
#### Post date: [May 3, 2024, 11:31am UTC](https://dmap-community.ductus.global/t/special-character-is-rejected-in-confd/4687/4 "2024-05-03T11:31:36Z")

</div>

Hi Joseph,

Thanks for your response.

But we need a tailf function which allows characters like \e, \f … instead of modifying the input with " " or \ to suit the condition. We cannot ask the user to update the string for all the configs as the same is being accepted on the router. Hence just to support this on CONFD we cant ask the customer configs to be updated.

Appreciate your help  
Logs :  
Router(config)# crypto ikev2 profile UNDERLAY  
Router(config-ikev2-profile)# authentication remote pre-share key 6 “abc\e”  
--------------------------------------------------------------------^  
syntax error: "abcs an invalid value.

---

<div class="post-metadata">

### Author: ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)
#### Post date: [May 3, 2024, 3:01pm UTC](https://dmap-community.ductus.global/t/special-character-is-rejected-in-confd/4687/5 "2024-05-03T15:01:43Z")

</div>

hmm, i understand the use-case, but i don’t know whether there’s a guarantee that running config output is/can be used as input/executable config commands. CLI has own core rules and I don’t know whether this one can be adjusted/changed - maybe someone else can chime in?
