login about faq

Using variables in the name of the SFTP home directory

asked Dec 27 '10 at 18:53

SSH%20KB's gravatar image


It is possible to use variables in the name of the user's home directory. The supported variables are %username%(will be "domain\user"), %username-without-domain%(will be "user"), %hostname% (refers to the hostname of the connecting client), and %homedir%. Below is an example using the %username% variable.
Solution: You simply need to create a virtual directory that exactly matches the "home" directory setting.

Tectia will recognize these as the same directory, and will display the username as the current home folder instead of HOME.

Note: In some cases (when the server is a part of the domain) you may have to use %username-without-domain% instead of just %username%


answered Dec 27 '10 at 19:00

renaes's gravatar image


Is there a way to do this without providing an arbitrary name for the virtual folder?

For example, consider this configuration:

<subsystem type="sftp" action="allow" application="sft-server-g3" audit="yes" exec-directly="no">
  <attribute name="home" value="F:\SFTP\%username-without-domain%\" /> 
  <attribute name="virtual-folder" value="home=F:\SFTP\%username-without-domain%\" /> 

This works, but the user is dumped into the /home directory upon SFTP login. Using nothing or slash for the name in the virtual-folder attribute does not work. I would like the user's starting/home directory to be "/", and map up to "F:SFTP%username-without-domain%"

This configuration was possible with WinSSHD virtual filesystem layout, but cannot seem to replicate in Tectia.


answered Apr 20 '11 at 17:09

AdamL's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Dec 27 '10 at 18:53

Seen: 8,912 times

Last updated: Apr 20 '11 at 17:09

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.