# /dev/ttyUSB0 Permission denied

**URL:** <https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695>\
**Category:** General\
**Created:** [7 November 2023 18:55 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695 "2023-11-07T18:55:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris378](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@Chris378](https://discourse.nodered.org/u/Chris378)\
**Post date:** [7 November 2023 18:55 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/1 "2023-11-07T18:55:12Z")

</div>

Dear Community

I"m running Node-Red in a vitual Lubuntu machine and get this error when trying to connect to USB port. I checked that my user is part of dialout group.  
Dies anybody has other suggestions how to fix that?

Chris

---

<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:** [7 November 2023 19:08 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/2 "2023-11-07T19:08:27Z")

</div>

Welcome to the forum @Chris378

Perhaps the virtual machine does not have access to the hardware.

---

<div class="post-metadata">

**Author:** ![Chris378](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@Chris378](https://discourse.nodered.org/u/Chris378)\
**Post date:** [7 November 2023 19:57 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/3 "2023-11-07T19:57:31Z")

</div>

Hi Colin

I guess in this case the file ttyUSB0 wouldn"t exist, what I also experienced, but finally it was there.

---

<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:** [7 November 2023 20:45 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/4 "2023-11-07T20:45:56Z")

</div>

Please show us the output from the command `ls -l /devttyUSB*`

---

<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:** [7 November 2023 21:24 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/5 "2023-11-07T21:24:41Z")

</div>

Should that be `/dev/ttyUSB*`?

---

<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:** [7 November 2023 21:26 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/6 "2023-11-07T21:26:11Z")

</div>

Blasted keyboard! Need a new one, I think I've worn this one out and I've only been typing on it for 16 hours a day, 7 days a week for 10 years. Dunno what they make em from these days. 😀

---

<div class="post-metadata">

**Author:** ![Chris378](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@Chris378](https://discourse.nodered.org/u/Chris378)\
**Post date:** [8 November 2023 06:32 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/7 "2023-11-08T06:32:07Z")

</div>

Good Morning

This is:  
crw-rw-rw- 1 root dialout 188, 0 Nov 8 7:22 /dev/ttyUSB0

Before, with htop I checked which user/process is running node-red, and it was root, so I added root to group dialout, but same result.  
I also tried this chmod 666 /dev/ttyUSB0.  
Same result.

---

<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:** [8 November 2023 09:28 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/8 "2023-11-08T09:28:17Z")

</div>

On my server it looks like this:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/e/9e7106822fa8a9e4492f43a3fef42af2000736b6.png)

Which is correct, USB ports should not be open as they are on yours (with the 3rd `rw`).

The correct approach for Node-RED to access the USB ports is to install it with its own user/group and to add that user to the `dialout` group. It then has all the access it requires. This is how it is set up on my server and I have 2 USB devices connected and working fine. Though personally, I specify serial devices by ID and not by the generic tty number which can occasionally swap around.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/2/82712b2289346fc315b0657cd048e4c454c0b124.png)

---

<div class="post-metadata">

**Author:** ![Chris378](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@Chris378](https://discourse.nodered.org/u/Chris378)\
**Post date:** [8 November 2023 13:19 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/9 "2023-11-08T13:19:56Z")

</div>

Hello

Yes, it seems you`re absolutely right. If I start node-red server with this  
sudo -u node-red  
it works.  
But it was not my intention to install and run it with another user, I just followed the instructions.  
Is there any way to change that, or do I have to uninstall and reinstall (but how is it correct?)

Thanks.

---

<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:** [8 November 2023 14:17 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/10 "2023-11-08T14:17:26Z")

</div>

If you are able to take your service down for a bit, then clearing it all out and starting again would be preferable. We often see people struggling with permissions here in the forum and that is nearly always down to inappropriate use of root installs.

If you are on a Debian based server, then Dave's install script is as close to an official comprehensive install as you will get. Personally, I prefer to install and document things so that I know what to do and can debug any install problems. My alternate install has a script but it only covers installing Node-RED in a specific way. Everything else is up to you but there are examples to amend and use as you need to.

Obviously, you should also fix the permissions on the USB device configs as well. It really does "just all work" if done in one of these recommended ways.

---

<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:** [7 January 2024 14:17 UTC](https://discourse.nodered.org/t/dev-ttyusb0-permission-denied/82695/11 "2024-01-07T14:17:53Z")

</div>

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