Connect to SFTP on Ubuntu Without Shell Access

In this tutorial, we will first touch up on what is SFTP and then give you a step-by-step tutorial on how to access it via Ubuntu without having shell access.

Updated: 20 Mar, 24 by Elizabet J 6 Min

List of content you will read in this article:

Are you ready to streamline your file transfer processes securely? Look no further! In this comprehensive guide, we'll walk you through the step-by-step process of installing and setting up an Ubuntu SFTP (Secure File Transfer Protocol) server. Whether you're a novice or a seasoned Linux user, our instructions will ensure a smooth installation and configuration process. By the end of this guide, you'll have a robust SFTP server up and running on your Ubuntu system, ready to securely transfer files across your network. Let's dive in and discover how to install and set up an Ubuntu SFTP server efficiently.

Connecting to SFTP-server ubuntu (SSH File Transfer Protocol) without shell access provides various benefits and use cases such as:

  • Enhanced Security: By restricting users to SFTP access only and denying them shell access, you can reduce the danger of unwanted access to your servers. Ubuntu SFTP connect works within an encrypted SSH tunnel, giving a safe way to transfer files while reducing the risk of security breaches.
  • Compliance Requirement: In some industries or organizations, compliance standards may necessitate rigorous control over user access to server resources. Limiting users to SFTP access without shell access allows you to meet compliance standards while also maintaining a more secure environment.
  • Simplified User Experience: For users who are unfamiliar with command-line interfaces or shell commands, Ubuntu SFTP connect without shell access is a more intuitive experience. SFTP client apps often have graphical interfaces that let users navigate and manage their data securely.
  • Granular Access Control: By separating SFTP-server ubuntu and shell access, you may enforce more granular access controls depending on user roles and permissions. This enables you to tailor access privileges to certain file directories or actions.
  • Improved Server Performance: Limiting shell access can assist boost server performance by decreasing the possibility of resource-intensive activities or illegal system modifications. By restricting users to SFTP access, you can reduce the possibility of unintentional or malicious activities affecting server stability or performance.

First of all, before we begin this tutorial and its configuration, we will introduce SFTP so that users who are not familiar with this file transfer protocol by SSH will have a better understanding of it.

Introducing SFTP

The SFTP, or the SSH File Transfer Protocol, is a file transfer protocol that is activated by default after installing Secure Shell on the Linux operating system. Using SFTP, you will be able to transfer or receive your files through a secure Linux tunnel.

This protocol is often confused with the FTP protocol or its unsecured form, but it should be noted that this protocol generally has all of its rules and conditions, and has nothing similar to the rules with FTP. Default access is provided to SFTP when the user has access to the shell, the SSH console, and the Linux Command Line Console.

Now, in this tutorial, we're going to teach Sneaker SFTP access without the need for Shell in Ubuntu 18, with the setup that runs on the Linux server so you can easily give users access to the file transfer without being able to connect to Shell.SFTP Access Without Shell in Ubuntu 18

1- Connect to your Linux VPS Server system first through SSH and Root user.
2- Then enter the following commands to Create SFTP User.

adduser elizabet
passwd  elizabet

After entering the second command, enter the password twice to set the password on the user.

3- Now create a directory to access the SFTP for the user you want.

mkdir -p / var / sftp / files

In this command, a directory named SFTP is created and inside it is created another directory named files.

4- Give the root user permission to access these directories.

chown root: root / var / sftp

5- Then provide the necessary access to file the user to the file directory.

chown elizabet: elizabet / var / sftp / files

6- Continue to set the Elizabet user's SFTP access control to only the file directory. After connecting Elizabet to the SFTP, we will only connect to a specific DIRECTORY and not see other directories.

To do this, first, open the SSH configuration file with the Nano editor or any other editor you want.

nano / etc / ssh / sshd_config

Then copy the following statements at the end of the file.

Match User Elizabet
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory / var / sftp
Permit tunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

Note that in the Match User section, you must enter the username you created, and in the ChrootDirectory section, also enter the directory address created for this user.

Then save the file and exit.

7- Restart the service to make changes to the SSH service.

systemctl restart sshd

8- You can now connect to your Linux VPS Server through WinSCP software or other SFTP or SFTP commands from another Linux user.

Congratulations on successfully setting up your Ubuntu SFTP server! You've now equipped yourself with a powerful tool for secure file transfers within your network. By following the steps outlined in this guide, you've established a reliable means of transferring files while prioritizing security. Remember, maintaining your SFTP server's security is crucial, so regularly update your software and monitor for any potential vulnerabilities. With your Ubuntu SFTP server in place, you can confidently exchange files knowing that your data remains protected. Thank you for choosing our guide on how to install and set up an Ubuntu SFTP server. Happy file transferring!

To use SFTP in Ubuntu, you can connect to an SFTP server using an SFTP client application. Open the terminal and type `sftp username@hostname` to initiate an SFTP session, replacing "username" with your SFTP username and "hostname" with the server's hostname or IP address.

To access SFTP on Linux, you can use the `sftp` command in the terminal. Simply open a terminal window and type `sftp username@hostname`, replacing "username" with your SFTP username and "hostname" with the server's hostname or IP address. You'll be prompted to enter your password to complete the connection.

The default SFTP port in Ubuntu is 22. SFTP typically runs over SSH (Secure Shell), and SSH uses port 22 by default for secure connections. However, this port can be customized in the SSH configuration if needed.

The SFTP subsystem in Ubuntu is a component of the OpenSSH server package that provides support for the SSH File Transfer Protocol (SFTP). It allows users to securely transfer files between computers over a network using the SSH protocol. The SFTP subsystem is responsible for handling SFTP sessions and managing file transfers on the server.

Elizabet J

Elizabet J

One OF my major goals is getting new experiences about ICT and what’s more making progress through this field.