Database / ValKey Interview questions
How do you use the Valkey CLI to connect to a remote, password-protected server?
valkey-cli accepts host, port, and credential flags so it can reach a remote instance without editing any config file.
valkey-cli -h 10.0.0.5 -p 6379 -a mypassword # with an ACL user instead of the default user valkey-cli -h 10.0.0.5 -p 6379 --user appuser --pass secret --no-auth-warning # cluster mode: follow -MOVED redirects automatically valkey-cli -c -h 10.0.0.5 -p 6379
Supplying -a on the command line is convenient but discouraged in production, since the password can end up visible in shell history or in the process list to other users on the same host.
More Related questions...