su - user : /dev/pts/# Operation not permitted problem
The subject about explains it all.
su - user used to work fine, then it seemed to stop working properly and is now giving me this error: as root... su - buaku /dev/pts/0: Operation not permitted It changes to the user just fine, but I'm wondering about the error. The user is using the bash shell, with no .profile or .login or anything I read somewhere else about adding the user to the wheel group, but that dind't help. Also tried adding the user to the tty group with no luck. Anyone else have any ideas? |
Does this look familiar?
Code:
mingdao@james:~$ pwd who really knows about this. Code:
mingdao@james:~$ ls -al /dev/pts/2 And the output on my box shows nobody has perms for group tty: Code:
mingdao@james:~$ less /etc/group and user root, user anna was allowed to "su - anna" and had her working environment in both instances. I'm sorry I'm not much help, just posting what happens on one of my Slack boxen. Looks like I've changed users to anna and that I have her environment variables, though. |
Yeah that looks about right.
I've read it could have something to do with the tty permissions, like when you su to the new person, it's trying to do something to the tty, but the tty is still owned by the old person. So in your example when you su to anna, she is trying to do something to the tty, but mingdao still owns it or something. I've seen stuff like check your login scripts for something to do with 'mesg n' or 'biff y'. In my case my user doesn't have any login scripts of their own, just the system ones I guess. I don't remember this always happening, but its possibly I never noticed it till now. |
Upon further inspection of my /etc/profile it does have a line in there that runs 'biff y'.
I also tried tcsh as my users shell and still got the same error and looking in the /etc/csh.login it also has a 'biff y' line. After commenting out that line I redid the 'su - buaku' command and I don't get the /dev/pts error anymore. So...biff is the culprit. The biff man page even mentions the fact it doesn't play nice with 'su'. Quote:
Kind of odd though. |
/etc/profile contains the following
# Notify user of incoming mail. This can be overridden in the user's # local startup file (~/.bash.login or whatever, depending on the shell) if [ -x /usr/bin/biff ]; then biff y fi just comment out the like that says "biff y" |
All times are GMT -5. The time now is 08:12 AM. |