Based on the search results provided, here are the key steps to set up a user with SFTP access only, without shell access:
1. Create a new user account for SFTP access, for example "mysftp":[2]
```
adduser mysftp
passwd mysftp
```
2. Create a directory for the SFTP user to access, for example "/var/sftp/uploads":[2]
```
mkdir -p /var/sftp/uploads
chown root:root /var/sftp
chmod 755 /var/sftp
chown mysftp:mysftp /var/sftp/uploads
```
3. In the SSH server configuration file (/etc/ssh/sshd_config), add the following settings:[2][3]
```
Match User mysftp
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/sftp
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
```
This restricts the "mysftp" user to SFTP access only, without shell access.
4. Restart the SSH service to apply the changes:[2]
```
systemctl restart sshd
```
5. Verify the user can only access SFTP and not the shell:[2]
```
ssh mysftp@localhost # Should show "This service allows sftp connections only"
sftp mysftp@localhost # Should allow SFTP access
```
The key points are to create a dedicated SFTP user, restrict their access to a specific directory, and use the SSH configuration to force the use of SFTP without shell access. This approach allows granting limited file transfer access without full system access.[1][2][3][4][5]