Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PuTTY: Change default SSH login directory [closed]

In Windows, I use PuTTY to log in a Linux-based remote server via SSH.

Is is possible to change the default directory entry point I get to after I connect and login? (That would be a nice time saver.)

e.g. from server/home/ to server/home/subdir/subdir/

like image 996
Bernd Avatar asked Aug 20 '10 11:08

Bernd


People also ask

How do I change the working directory in PuTTY?

Just type “pwd” and hit enter. cd: Now, you are at a location and you want to navigate to another. Type “cd /location” and you will reach that location. It stands for “change directory”.

How do I change directory in SSH terminal?

Change the working directory Navigate your server's filesystem using the cd command. cd /path/to/your/directory – change the current working directory to the nominated path. Note that the first / indicates the path is relative to the root directory.


2 Answers

You can also change the directory within PuTTY itself:

  1. Configuration → Connection → SSH

  2. Fill in the "Remote command" field with the following:

    cd subdir/subdir ; /bin/bash 
like image 81
lagivan Avatar answered Oct 14 '22 05:10

lagivan


  • Add cd subdir/subdir to ~/.bashrc or ~/.bash_profile, or
  • change the home directory of the user.
like image 34
Sjoerd Avatar answered Oct 14 '22 06:10

Sjoerd