Forum: 

Change standard ssh opening folder

nielsharland's picture

Hi,

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,
Niels 

Liraz Siri's picture

  • 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 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?

Daniel Serodio's picture

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