LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   su - user : /dev/pts/# Operation not permitted problem (https://www.linuxquestions.org/questions/slackware-14/su-user-dev-pts-operation-not-permitted-problem-352029/)

buaku 08-10-2005 08:59 PM

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?

Bruce Hill 08-11-2005 05:59 AM

Does this look familiar?
Code:

mingdao@james:~$ pwd
/home/mingdao
mingdao@james:~$ su - anna
Password:
/dev/pts/2: Operation not permitted
anna@james:~$ pwd
/home/anna
anna@james:~$ $PATH
-su: /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.: No such file or directory
anna@james:~$ su -
Password:
root@james:~# su - anna
/dev/pts/2: Operation not permitted
anna@james:~$ pwd
/home/anna
anna@james:~$ $PATH
-su: /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.: No such file or directory
anna@james:~$ exit
logout
root@james:~# exit
logout
anna@james:~$ exit
logout
mingdao@james:~$

I'm just thinking out loud here, since no one showed up yet
who really knows about this.
Code:

mingdao@james:~$ ls -al /dev/pts/2
crwx-w----  1 mingdao tty 136, 2 2005-08-11 16:55 /dev/pts/2

I don't know the purpose of that, but users have no perms there.
And the output on my box shows nobody has perms for group tty:
Code:

mingdao@james:~$ less /etc/group
tty::5:

However, as you can see from my output, from both user mingdao
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.

buaku 08-11-2005 07:03 PM

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.

buaku 08-11-2005 07:25 PM

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:

su(1), and biff don't seem to get on too well. This is probably due to
the tty still being owned by the person using su. This can result in
``Permission denied'' messages when attempting to change the biff status
of your session.
I guess that solves the problem, hehe.
Kind of odd though.

scripthead 10-16-2005 08:08 PM

/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.