If users have access to the files on your server, but you don’t want they to be able to execute commands, you can limit access to sftp only.
Add a user to your system as normal with a password and then run the following command:
usermod -s /usr/lib/sftp-server username
Then change add the following to /etc/shells to make it a valid shell:
echo '/usr/lib/sftp-server' >> /etc/shells
Now this user can only run the sftp server as shell