I have the following script:
cat > /tmp/script.sh <<EndOfScript
#!/bin/sh
ulimit -n 8192
run_app
EndOfScript
which runs smoothly locally, it is always in order. But if I try to run it remotely via ssh:
scp /tmp/script.sh user@host:/tmp/script.sh
ssh user@host "chmod 755 /tmp/script.sh; /tmp/script.sh"
I got an error:
ulimit: open files: cannot modify limit: Operation not permitted
I also tried the following command:
ssh user@host "ulimit -n 8192"
same mistake.
It seems that executing the remote ssh command provides a limitation of the 1024 hard drive on the nofile sheet, but I cannot find out how to change this default value. I tried changing /etc/security/limits.conf and restarting sshd, still the same error.
source
share