SSH NEW File creation is different ( Notepad++) as vs direct Edit under NANO

Advertisement

Rar9
Joined:
Posts:
2
Location:
Germany

SSH NEW File creation is different ( Notepad++) as vs direct Edit under NANO

Hello

I created a "config.gateway.json" with some rules that was created with Notepad++ that was not recognised by my Unifi Linux Controller.

I manage to get it fixed by just Cut & Pasting the Same rules into my SSH Nano Editor and the Controller accepts the File.

Is this bug in Winscp transfering via SCP or could it be Notepad++ doing something to the file ?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: SSH NEW File creation is different ( Notepad++) as vs direct Edit under NANO

Can you download the file back (in a binary mode) and attach it here, for us to check?

Reply with quote

Rar9
Joined:
Posts:
2
Location:
Germany

{
"firewall":{
"name":{
"LAN_IN":{
"default-action":"accept",
"description":"packets from intranet",
"rule":{
"2001":{
"action":"drop",
"description":"Device 1",
"protocol":"all",
"source":{
"mac-address":"xx:xx:xx:xx:xx:x1"
},
"time":{
"starttime":"21:30:00",
"stoptime":"06:30:00",
"weekdays":"Mon,Tue,Wed,Thu,Sun"
}
},
"2002":{
"action":"drop",
"description":"Device 2",
"protocol":"all",
"source":{
"mac-address":"xx:xx:xx:xx:xx:x2"
},
"time":{
"starttime":"21:30:00",
"stoptime":"06:30:00",
"weekdays":"Mon,Tue,Wed,Thu,Sun"
}
},
"4001":{
"action":"drop",
"description":"Device 1",
"protocol":"all",
"source":{
"mac-address":"xx:xx:xx:xx:xx:x1"
},
"time":{
"starttime":"23:00:00",
"stoptime":"06:30:00",
"weekdays":"Fri,Sat"
}
},
"4002":{
"action":"drop",
"description":"Device 2",
"protocol":"all",
"source":{
"mac-address":"xx:xx:xx:xx:xx:x2"
},
"time":{
"starttime":"23:00:00",
"stoptime":"06:30:00",
"weekdays":"Fri,Sat"
}
}
}
}
}
}
}

Reply with quote

Advertisement

max123kl
Joined:
Posts:
3
Location:
germany

Re: SSH NEW File creation is different ( Notepad++) as vs direct Edit under NANO

Rar9 wrote:


I created a "config.gateway.json" with some rules that was created with Notepad++ that was not recognised by my Unifi Linux Controller.

I manage to get it fixed by just Cut & Pasting the Same rules into my SSH Nano Editor and the Controller accepts the File.

Is this bug in Winscp transfering via SCP or could it be Notepad++ doing something to the file ?
If you use notepad++ on a windows machine and nano on a Linux machine you may use two different code pages. On windows notepad++ uses ANSI as default. Try to change Encoding/Kodierung to UTF8, which is used by Linux as default. Convert and save the file again.

Reply with quote

martin
Site Admin
martin avatar

Anonymous wrote:

??? can't you cut & Paste it as json is not allowed for upload
That won't help. We need to see an exact binary representation of the file.

Reply with quote

Advertisement

You can post new topics in this forum