# [SOLVED] Broken sudo while in X

## teknocrust

Hey, ever since the last set of update sudo no longer works, but only when i'm in X, at the console it works fine..

I've traced the issue down several things to the following line from

1.

/dev/tty at boot has bad permissions root:root instead of root:tty breaking xterm 

after a chown that.. i get the next issue

2.

```

/etc/pam.d/sudo

auth      required   pam_unix.so debug

```

If I remove that line it will login without any password prompt via pam_permit.so

The issue is that a command like 'sudo ls' doesn't throw any error it just sits and waits forever until i break out of it..

.. itseems to be that it DOES prompt for the password but on my console at vt04 (where i run X) the same console that X11 is running on, after I kill my X session i'll see a list of 

password:

password:

password:

password:

lines on the console...

the only error i see appears after i ^C out of sudo..

[pam_ssh] can't get passphrase from PAM

[sudo] pam_unix(sudo:auth): conversation failed

[sudo] pam_unix(sudo:auth): auth could not identify password for [*****]

why isn't it prompting me in my xterm instead?? I can't figure this one out at all

any helpful pointers would be great....

PS: Also I use slim normally, and tried xldm but it is also broken for me right now.. i also run awesome-wm..

PPS: 'less' as a pager option is also broken!!Last edited by teknocrust on Sat Apr 27, 2013 5:35 pm; edited 1 time in total

----------

## teknocrust

Still having this same issue

narrowed it down to the following....

with /dev/tty set to root:tty 0660

less    works while in X (non root user only)

sudo works fine

su works fine

with /dev/tty set to root:tty 0666 (the proper permissions)

less broken for root and non-root users

sudo broken for all users (never prompts for password)

(sudo also will not obey calls to SUDOASKPASS that i have set)

su works fine

strace doesn't give me any insight..

and all my config files appear to be in good order...

This behavior only occurs in X, at console less and sudo appear to work fine..

any ideas???? I'll take anything!

----------

## khayyam

 *teknocrust wrote:*   

> any ideas???? I'll take anything!

 

teknocrust ... it might be an idea to compare with this thread as both have similar symptoms.

I was using 3.7.10 for some time and had no issues with /dev/tty ... not that this rules out the kernel, but makes it less likely ... and as I remember the user from the above thread is using 3.8.x

Late for me so I'll leave it at that ... best ... khay

----------

## teknocrust

YAY thanks for the reference here is the issue and how I solved it

I noticed from referenced posts that it looks like my initrd scripts or something was replacing /dev/tty

by doing an init-ram hack of *Quote:*   

>  cp -a /dev/console /dev/tty

 

this is bad as they are not the same nodes!

/dev/console is c 5 1

/dev/tty is c 5 0

```

rm /dev/tty

mknod -m 0666 /dev/tty c 5 0

chown root:tty /dev/tty

```

After I did that, my less, xterm, sudo and gpg all worked again!!!

This fix should also work for this thread too

https://forums.gentoo.org/viewtopic-p-7294300.html

----------

