PuTTY: Change default SSH login directory [closed]
开发者_开发百科
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this questionIn 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/
You can also change the directory within PuTTY itself:
Configuration → Connection → SSH
Fill in the "Remote command" field with the following:
cd subdir/subdir ; /bin/bash
- Add
cd subdir/subdir
to~/.bashrc
or~/.bash_profile
, or - change the home directory of the user.
You could use screen to keep your current directory by always logging into the same screen session.
Add the screen command with parameters to your putty saved session under SSH>Remote Command. See the screen documentation for which parameters to use.
screen -R -O -t mysession -S mysession -f
Depends on a lot of things. Mainly the server operating system. Most SSH servers run Linux or Unix of some flavor. When you connect via any method of remote text login (as SSH is one member of this category) such a system will automatically spawn a shell process to talk to you. That's probably "bash", and it runs various things on startup. Check out
man bash
to learn more. One of the many things you can do is cd to a subfolder.
精彩评论