SSH error on jailed shells (mesg)
AlmaLinux v8.10.0 STANDARD kvm
WHM v120.0.16
Howdy, starting an ssh session results the banner message, then notice of last login.
If jailed shells are enabled for an account, there's an additional message after that:
mesg: ttyname failed: No such device
It doesn't break the shell or anything, but is annoying to see.
/etc/bashrc does contain:
mesg y
The program (mesg) lives in /usr/bin, which is present in $PATH.
Calling msg directly results in the same:
ttyname failed: No such device
Root and non-jailed shells don't get this error when logging in.
I could manually edit /etc/bashrc and comment out the call to mesg, but that doesn't seem the right thing to do.
The bigger question is: Why is the error appearing for jailed shells, and what's a good workaround?
If anyone knows, please advise.
Thanks!
-
Hey there! Editing bashrc might be the correct thing to do here. When I check both my personal AlmaLinux 8 machine as well as a test server, I don't see any "mesg" lines in the main /etc/bashrc file, so I'm wondering if that was added to your configuration at some point.
0 -
Thanks for getting back to me. Assumed it was there on purpose, but then again, cPanel's been running on this VPS for > 15 years so there's bound to be a bit of kruft in there from earlier installations. ;)
Should have also mentioned I only recently turned on jailed shells, so hadn't previously seen the behavior. Am pretty much the only one that administers this server but better safe than sorry in case some stray code from one account somehow gets in there (had a user's email credentials get compromised once and occasionally cc's were being added to a .ru address in valiases. Didn't snap at first that it was just the one account. PW change fixed that one, but since they were able to touch the aliases file via RoundCube, who knows what else they may have been able to mess up).
Will remove the entry. Take care!
0 -
Sounds good - let us know if you need anything else!
0
Please sign in to leave a comment.
Comments
3 comments