Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/dev/tty default permissions #617

Closed
therealkenc opened this issue Jul 2, 2016 · 11 comments
Closed

/dev/tty default permissions #617

therealkenc opened this issue Jul 2, 2016 · 11 comments

Comments

@therealkenc
Copy link
Collaborator

therealkenc commented Jul 2, 2016

Hit this looking at #612. It turns out you can't actually run sshd out of the box as non-root on port 2222. ssh -vvv -p 2222... fails with read_passphrase: can't open /dev/tty: Permission denied. This is because on WSL, /dev/tty has root:tty 600 permissions. On native Ubuntu it appears to be 666. sshd performs as expected if you sudo chmod 666 /dev/tty, but the perms are not persisted across bash.exe sessions. [edit - not persisting /dev permissions is the linux behavior across reboot too; who knew.] Request is to make the WSL default perms for /dev/tty 666 like on native.

@therealkenc
Copy link
Collaborator Author

I figured out now why my /dev/tty is owned by root - it's because I have lxrun.exe /setdefaultuser root. Fair enough, but it would still be nice if /dev/tty had 666 perms or even 660 would do.

@dextermarkley
Copy link

I experienced this issue as well. I used:

sudo chmod 0666 /dev/tty

resolved my issue.

@DMaiorino
Copy link

A very small tweak, but you can adjust the permissions even further to add writable only to the group.

sudo chmod g+w /dev/tty*

This will match what is used in other Linux distros, and not add more permissions than needed.

@arcanis
Copy link

arcanis commented Aug 6, 2016

It solves the issue, but unfortunately only until the next login. I'm not sure how to make it permanent - maybe by executing this straight from .bashrc ?

@therealkenc
Copy link
Collaborator Author

therealkenc commented Aug 7, 2016

I just hope they'll change the perms to 660 as the default. Having a tty group without permission to write to /dev/tty is, well, weird.

@therealkenc
Copy link
Collaborator Author

therealkenc commented Nov 5, 2016

Interesting. Somewhere along the way /dev/tty permissions became 666 without fanfare or comment from the powers that be. This can be closed and marked as fixed.

@jmzagorski
Copy link

I checked this today and mine is still 600. I start bashed logged in as another user so this is problematic. @threalkenrc is it still 666 for you?

@therealkenc
Copy link
Collaborator Author

Nah, just checked for you on 17074 and Store Ubuntu 16.04.3 and it is okay here.

@jmzagorski
Copy link

jmzagorski commented Jan 21, 2018

should this be reopened? This was an issue with using git+ssh with a passphrase. I am getting around it with the chmod 660 on every login

@therealkenc
Copy link
Collaborator Author

therealkenc commented Jan 21, 2018

Won't be re-opened because it was indeed fixed (in general) in 2016. You can open a new issue if you like though; I won't dupe you back down here. But for the new issue to be constructive it will need a repro. So be real specific about "I start bashed logged in as another user so this is problematic". Something like step (1) Buy a computer from Costco, (2) Perform Windows setup with user 'sid', (3) Log in as 'sid' and create user 'nancy' (4) Install Ubuntu from the Store as user 'sid', (5) log in as 'nancy', (6) ... (n) ... (m) ls -l /dev/tty shows mode of 600. Otherwise, unless you are lucky enough to get some me2s, it might run the risk of ending up on the need-repro pile. If you're seeing 600 that's totally a legit problem, but I don't have any quick guesses as to why off the cuff.

@ChuckM
Copy link

ChuckM commented Apr 12, 2018

I have this issue as well. Everytime you start the permissions are set poorly to 600. How can I have them set to something more useful and make that sticky?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants