Bug 46635

Summary: Can't ssh after su (/dev/tty permission denied)
Product: Base System Reporter: Thomas Quinot <thomas>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Thomas Quinot freebsd_committer freebsd_triage 2002-12-30 16:30:02 UTC
	If I su from one user to another, I am unable to make an
	outgoing ssh connection from the su'd shell using password
	authentication, because ssh tries (and fails) to open /dev/tty
	(which still belongs to the original user).

	This used to work on -STABLE because /dev/tty was not the same
	device as the actual tty device, and could therefore have 666
	permissions (which make sense -- allowing each process to open
	its own controlling tty).

Fix: 

None known so far (apart from working around the problem
	by setting /dev/tty* to 0666...).
How-To-Repeat: 
zuydcoote# ls -l /dev/tty
crw--w----  1 root  tty    5,   0 Dec 30 17:22 /dev/tty
zuydcoote# su - quinot
(quinot@zuydcoote) ~ $ ssh remote.host
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password,hostbased).
(quinot@zuydcoote) ~ $ ls -l /dev/tty
crw--w----  1 root  tty    5,   0 30 dec 17:22 /dev/tty
Comment 1 Poul-Henning Kamp freebsd_committer freebsd_triage 2003-01-13 22:20:59 UTC
State Changed
From-To: open->closed

This should be fixed with rev 1.58 of devfs_vnops.c. 

Thanks for a good analysis.