Why must s be kept secret in pedersen commitments? I was reading up on Pedersen commitment over at this website: https://asecuritysite.com/encryption/ped, where they calculate $h=g^s \bmod p$, and they say that $s$ must be a secret.
I wonder why this is a requirement? Since verifiers will know the value of both $h$ and $g$ anyways, and a random value $r$ is used for creating the commitment, I don't see why $s$ must be kept secret?
I wonder why this is a requirement?

If the prover knows what $s$ is, they can open the commitment to any value they want.
Suppose that the commitment was $c = g^x h^r$, where $x$ is the originally committed value.
Then, if the prover knows $s$, then he can take an arbitrary value $y$ and compute $r' = r + s^{-1}(x - y)$; then, he can open the commitment as $c = g^y h^{r'}$
This would be accepted as a valid opening, because $g^xh^r = g^{x+sr} = g^{x + s(r' - s^{-1}(x-y))} = g^{y + sr'} = g^y h^{r'}$, and so he has successfully opened the commitment to a value selected after the commitment was published.