TurnKey Linux Virtual Appliance Library

Change standard ssh opening folder

nielsharland's picture


When I open a ssh connection to a Turnkey server he starts in the folder /root/. I want to change this standard folder to /var/www/. Is this posible?

Kind regards,

Liraz Siri's picture

Several ideas

  • You could change root users home directory (e.g., edit /etc/passwd)
  • You could create another user with /var/www as the home directory
  • You can configure your shell to cd /var/www, or do pretty much anything. (e.g., edit $HOME/.bashrc)

In short, there are many ways to accomplish your goal. I recommend you experiment a bit to see what works best.

nielsharland's picture

Thanks a lot, it's al verry

Thanks a lot, it's al verry new for me 
But I have changed the user root folder via /etc/passwd... Simply because it was the only option that said clearly to me 'change this line' ..

But for further goals, can you please explain how to change the shell cd via the bashrc file?

Guest's picture

The /etc/bashrc file is a

The /etc/bashrc file is a shell script (think Windows batch file) that gets run every time any user logs in, so if you edit that file and add a cd /some/dir to its end, this command would get executed anytime someone logged in.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)