SSH with Putty default path

Posted on

SSH with Putty default path – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, ssh, , , .

When logged in to the server I don’t want to cd /path/to/directory every time I connect to the server. I’m connecting via Putty. I’ve tried to execute a command once connected to change the directory, but it just closes Putty.

Solution :

You can probably just append cd /path/to/directory to your .bashrc.

Alternatively if you’re the admin of the server you may want to change your home directory to point there.

Edit: as @smintz says this is probably not a good idea if you don’t own the directory. I’ve seen it done though, so I thought I’d point it out.

You can put cd /path/to/directory in your .bash_profile if you want it to happen only when you log in. If you want it to occur whenever you open a shell then you should use your .bashrc.

If you want to do it from PuTTY then get KiTTY which is a fork of PuTTY. Under the Data section of session configuration you can define a command to run at login.

Do you want to run “cd …” every time you log into that server or just when you use putty? If you just want to do this when you use putty, you can have putty set an environment variable and then check for that when you log in, but your ssh server must turn on AcceptEnv (assuming openssh)

Leave a Reply

Your email address will not be published.