Ubuntu – How to permanently change permissions for /dev/ttyS0

permissionsserial portvirtualbox

My system is Ubuntu 13.04 and it works fine, but I have installed VirtuaBox to run Windows XP, which is essential for me to run an application that dialogues with an alarm setup by a USB-to-Serial adapter.

VirtualBox uses ttyS0 as a Serial port and the communication can start efficiently only if command sudo chmod 666 /dev/ttyS0 is given to Terminal.

Every time I boot Ubuntu, ttyS0 permissions return to the default values and I have to run chmod every time I boot-up.

My question is: how can I change /dev/ttyS0 file permission permanently? If this is not a good practice, are there other manners to solve the issue?

Best Answer

  • There's no need to change system file's permissions. The serial devices have the following default permissions:

    crw-rw---- 1 root dialout ... /dev/ttyS0
    

    So all you have to do is add the user to the dialout group:

    sudo adduser $USER dialout