Since pty
is limited, I want to modify the content of /proc/sys/kernel/pty/max
.
The original value in max is 4096, and now I want to modify it to 10000.
[root@home pty]# pwd
/proc/sys/kernel/pty
[root@home pty]# ls -lh
total 0
-rw-r--r-- 1 root root 0 Aug 13 11:24 max
-r--r--r-- 1 root root 0 Aug 13 11:24 nr
vim max
I edit the max file directly, using root, but it fails.
I use :w!
in vim, but then I see the following picture:
so I tried to chmod
max first, but that also failed:
[root@home pty]# chmod 666 max
chmod: changing permissions of `max': Operation not permitted
[root@home pty]# whoami
root
so, how can I change the content of /proc/sys/kernel/pty/max
?
Edit
@jon-lin:
it also failed using the sysctl
command:
[root@home kernel]# sysctl -a | less | grep pty
kernel.pty.nr = 2
kernel.pty.max = 4096
[root@home kernel]# sysctl kernel.pty.max=10000
error: "Operation not permitted" setting key "kernel.pty.max"
[root@home kernel]# sysctl -p kernel.pty.max 10000
error: unable to open preload file "kernel.pty.max"
[root@home kernel]# sysctl -p kernel.pty.max = 10000
error: unable to open preload file "kernel.pty.max"
@AlanCurry:
It also failed using echo:
[root@home pty]# cat max
4096
[root@home pty]# echo 10000 > max
bash: echo: write error: Operation not permitted
[root@home pty]# echo 10000 >> max
bash: echo: write error: Operation not permitted
[root@home pty]# cat max
4096