Banana Studio
News · BS Manager

SSH Server 0.13.0: Your SSH Shell Now Stays in Its Folders

SSH Server 0.13.0 makes the SSH shell follow the same rules as SFTP: each user's shell sees only the folders you set for them, read-only folders stay read-only, and hidden files stay hidden. It also fixes SFTP sessions that ended on a wrong path and two screens that slid under the status bar on Android 15 and later.

SSH Server 0.13.0: Your SSH Shell Now Stays in Its Folders
On this page

SSH Server 0.13.0: Your SSH Shell Now Stays in Its Folders

SSH Server 0.13.0 is now available on Google Play for phones, tablets and Android TV. This release closes a gap that some of you ran into: the SSH shell now follows the same rules as SFTP. Each user's shell sees only the folders you set up for them, and nothing else.

Why this matters

In SSH Server you give every user a list of folders. SFTP has always respected that list: a user who was given only Download saw Download and nothing more.

The SSH shell did not. When the same user opened a terminal with ssh, the shell started in the app's own private folder and could look around everything the app itself could reach. That was confusing ("Why can't I find my Downloads folder in the shell?"), and it meant that the folder list was not really a limit for anyone who used the shell.

From 0.13.0, the folder list is the limit everywhere.

Before: the shell could browse everything the app could reach. Now: only the user's folders, Download (writable) and Photos (read-only)

What the shell sees now

The shell sees exactly the folders SFTP shows for that user:

  • One folder: it appears as /. If you give a user /storage/emulated/0, then / in their shell is your internal storage.
  • Several folders: / lists them by their alias. A user with Download and DCIM (shown as Photos) sees exactly two folders in /: Download and Photos.
  • Everything else is gone. The rest of your storage, the app's own data and other apps' data are simply not there. Paths that would lead outside, including .. and Linux tricks through /proc, stay inside the user's folders.

Your usual shell tools keep working: ls, cd, cp, mv, find, cat, pipes, scripts and background jobs. Android's own system files stay readable so those commands can run, just as they are on any Android shell.

Here is a real session on SSH Server 0.13.0:

A real SSH session: pwd shows /, ls / shows Download and Photos, writing to Photos is refused, /storage/emulated/0 does not exist

Read-only folders and hidden files apply too

Two settings you already know from SFTP now work in the shell as well:

  • Writable: if a folder's Writable box is unticked, the shell can open and read it, and copy files out of it, but it can't create, change, rename or delete anything inside. You'll see Read-only file system, as on a read-only disk.
  • Show hidden files: if this is off for a user, files and folders whose names start with a dot (.ssh, .cache, …) are left out of listings in the shell too: ls -a, find, tab completion. As in SFTP, a hidden file can still be opened by its exact name.

The Users screen: the user has Download (Writable ticked) and Photos (Writable unticked)

How to set it up

There's nothing new to switch on. The shell uses the folders you already set for each user:

  1. Open SSH Server and tap Users.
  2. Tap the pencil next to a user.
  3. Under Access path, tap Add new and pick a folder. Repeat for each folder the user should get.
  4. Untick Writable for any folder that should be read-only.
  5. Tap ✓ to save. The next time that user logs in, their shell shows exactly these folders.

Don't want a user to have a shell at all? The Disable shell switch in the same screen still turns it off.

Works everywhere, no root needed

The new shell works without root on every device SSH Server supports: phones, tablets and Android TV, with 64-bit and 32-bit ARM and x86 processors. We tested it on Android 6 through Android 16.

On a few very old devices, mostly Android 6 and 7 with an outdated system kernel, the system lacks a feature the shell needs. There, SSH Server won't fall back to an unrestricted shell: the session shows a short message that the shell can't start, then closes. SFTP keeps working normally on those devices.

Two fixes

SFTP no longer drops your session on a wrong path. If you opened a path outside your folders, for example ls /storage/emulated/0, the connection could close with Connection closed. Now you get a normal "not found" message and keep working.

Before: Connection closed. Now: "not found", and the session continues

Users and SFTP Logs fit the screen on Android 15 and later. On newer Android versions, the title and back arrow of these two screens slid under the status bar. They now sit below it.

On Android 15, the Users screen title used to slide under the status bar; now it sits below it

Questions

My files used to be at /storage/emulated/0. Where are they now? In your user's folders. Run ls / to see them. If you gave the user your whole internal storage, it is / itself.

The shell says it is unavailable or can't start. What can I do? Check that the user has at least one folder under Access path, and that SSH Server has permission to access your files. If both are fine, your device is one of the few without the kernel feature the shell needs; SFTP still works.

Does this change SFTP? No. SFTP already worked this way. Only the shell changed, plus the SFTP fix above.

Get it

SSH Server 0.13.0 is rolling out on Google Play now:

Thanks to everyone who wrote in about the shell and SFTP. Keep the feedback coming!

Videos

SSH Server 0.13.0: what's new

Related posts