Hey
I just ran into this error on my Pi when I have tried to log into it via ssh from putty:
Server refused to allocate pty
It authenticates and then it kicks me out, the only resolution is to reboot the pi from within osmc whereupon ssh starts working again.
Disabling the ssh service via the “my osmc” icon doesnt work, restarting the media centre service doesnt work, restarting the ssh service via “sudo service ssh restart” may have worked but it was just easier to reboot than to hoak out a keyboard because there is no terminal within osmc (why doesnt someone build a limited python driven terminal emulator??).
I found a command to check the max number of tty (pseudo terminals) which was 4096:
cat /proc/sys/kernel/pty/max
I believe I have somehow maxed out the number of tty’s on my system although I have no idea how I managed to start over 4000 terminal sessions.
I tried the following steps which may or may not have resolved the problem:
sudo apt-get remove openssh-server
sudo apt-get install openssh-server
But as it only happened after my server being on for like a day its pretty hard to test.
The only thing I can think which I have done which would have caused this problem is that i have been trying to get sopcast working in plexus and each time you click on a sopcast link it loads a shell script which loads quemu which loads sp-sc-auth (sopcast).
The shell scripts has no exit command so would continually trying many sopcast links, which then fail to load, use up terminal sessions until i can no longer log in remotely?
I can still log in via winscp and access my pi via the remote app.
Firstly can anyone tell me how to kill all tty sessions if this happens again so i could maybe cron a script to periodically run?
And secondly if i needed to run this script from the remote control app, how would i do it?
Ok if i need to run the script from yatse you would do it by adding a custom command as follows:
Custom command
Add from media center
call built in
System.Exec(/home/osmc/scripts/kodirestart.sh)
So all I need to know now is how to kill idle tty terminal sessions via a script.
Cheers