You can limit the question to real symmetric matrices $A$ (with diagonal $0$ if desired). For large enough $k,$ the matrix $A+kI$ will be positive definite and you are then allowed to change all the diagonal entries.
As noted in a comment (and overlooked in my earlier answer) this $5 \times 5$ matrix (where the diagonal entries are free to be assigned) will have rank at least $4.$
$$ \left[ \begin {array}{ccccc} a&1&0&0&0\\ 1&b&1&0&0\\ 0&1&c&1&0\\ 0&0 &1&d&1\\ 0&0&0&1&e\end {array} \right] $$ The same construction works for any $n.$
It is curious that having the freedom to chose any diagonal matrix may be no more effective than being restricted to choosing a multiple of the identity matrix. Perhaps the special role of the identity matrix is relevant.