# Permission denied /dev/ttyS0

**URL:** <https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956>\
**Category:** Hardware\
**Created:** [29 April 2021 23:16 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956 "2021-04-29T23:16:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [29 April 2021 23:16 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/1 "2021-04-29T23:16:02Z")

</div>

Hi  
I am trying to get comms between a Pico and Pi3 (Pico as kHz freq counter). Looks like serial is the best option, so I have setup the Pico to send out serial data (looks OK on a scope) and trying to use the serial pins GPIO14+15 on the Pi3 (is this dev/ttyS0 ?).

I have enabled SERIAL in Raspi Config, but when I use the serial node I keep getting Permission Denied. I have tried all sorts of permission settings from other forums but nothing fixes it.

Help !

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 April 2021 23:29 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/2 "2021-04-29T23:29:50Z")

</div>

What is the permission on the device?

```auto
ls -l /dev/ttyS*

```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [30 April 2021 06:43 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/3 "2021-04-30T06:43:33Z")

</div>

Have you enabled the port ? And disabled Getty ?

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [30 April 2021 08:29 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/4 "2021-04-30T08:29:04Z")

</div>

Hi,

Have a look at this.

> **[Configuring The GPIO Serial Port On Raspbian Jessie and Stretch Including Pi...](https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3-4/)**
>
> The Raspberry Pi GPIO serial port configuration has changed under Jessie / Stretch / Buster and also with the Raspberry PI 3 / 4. How to set it up.

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [30 April 2021 09:40 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/5 "2021-04-30T09:40:19Z")

</div>

> [@TotallyInformation](#):
>
> `ls -l /dev/ttyS*`

crw--w---- 1 root tty 4, 64 Apr 30 10:39 /dev/ttyS0

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [30 April 2021 09:41 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/6 "2021-04-30T09:41:41Z")

</div>

I have enabled in the Raspi Config GUI. What is Getty ?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 April 2021 09:43 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/7 "2021-04-30T09:43:49Z")

</div>

So this is my Debian server:

```bash
ls -l /dev/ttyS*
crw-rw---- 1 root dialout 4, 64 Mar 29 04:02 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Mar 29 04:02 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 Mar 29 04:02 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 Mar 29 04:02 /dev/ttyS3

```

You can safely change the group owner to dialout (which should already exist, if not create it). This is the traditional setting for serial ports since they were most often used for modems back in the day.

Once that is done, add the user that runs Node-RED to the dialout group. Restart and all will be well.

You could, of course, add the node-red user to group `tty` but that is less secure, best to stick with the well trodden path.

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [30 April 2021 09:47 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/8 "2021-04-30T09:47:08Z")

</div>

Thanks. I dont recall the exact command but I already added the user 'pi' to the group tty and group dialout and no change ☹

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 April 2021 09:51 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/9 "2021-04-30T09:51:38Z")

</div>

Did you restart the device?

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [30 April 2021 09:56 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/10 "2021-04-30T09:56:17Z")

</div>

@all I have fixed it, I had a hunch and disabled the SERIAL CONSOLE in the Raspi Config and all has come good, had a hunch that the port was actually in use instead. Didnt find this anywhere, how obscure!  
Thanks all, appreciated.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 April 2021 09:59 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/11 "2021-04-30T09:59:54Z")

</div>

That is a well known problem and usually listed high on any forum talking about using the serial and usb ports. So well known that probably all of us have long ago disabled the serial console and no longer think about or remember it!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [30 April 2021 10:52 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/12 "2021-04-30T10:52:35Z")

</div>

getty == serial console 🙂

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [30 April 2021 19:27 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/14 "2021-04-30T19:27:46Z")

</div>

the pi user really should NOT be a member of the `tty` group

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [30 April 2021 22:40 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/15 "2021-04-30T22:40:52Z")

</div>

aha, well there you go then, every day a school day !

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [30 April 2021 22:41 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/16 "2021-04-30T22:41:09Z")

</div>

howcome ?

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [30 April 2021 22:44 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/17 "2021-04-30T22:44:27Z")

</div>

Didnt find that on my lookings at all anywhere, but will be part of my build checklist now for sure !!?!

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [30 April 2021 23:05 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/18 "2021-04-30T23:05:44Z")

</div>

Because the `tty` group has access to all terminals (including psudo terminals used by things like ssh and x-terms) so can effectively snoop on all terminal access including password entry.

Modern systems normally only give the `tty` group write access (for tools like `write` and `wall` to send terminal broadcast messages, but it is still VERY bad practice for a normal user to be a member of this group.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 May 2021 08:13 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/19 "2021-05-01T08:13:50Z")

</div>

The ttyS\* devices having a default ownership of tty must be a Pico specific thing. The default on a Pi is dialout as you would expect.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 May 2021 13:28 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/20 "2021-05-01T13:28:44Z")

</div>

There doesn't seem to be a universal agreement on this setting. WSL Ubuntu on Windows for example sets ownership to root:root

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 June 2021 13:28 UTC](https://discourse.nodered.org/t/permission-denied-dev-ttys0/44956/21 "2021-06-30T13:28:59Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
