Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to make the default ssh location be the folder that was current when last logged out?

I'm using bash and Ubuntu, so it looks like I could use the .bash_logout file to set a variable, but was wondering whether there is a better(/more correct) way.

share|improve this question
    
With 'location' you mean your cwd (current working directory) and with 'folder' you mean directory? –  mghocke Aug 6 '12 at 14:07

1 Answer 1

Use Gnu Screen is maybe the solution. Your shell stay open in screen (with your history, your path, your variables). Just connect to your server by SSH and do the screen -r to restore the session.

share|improve this answer
    
And you can happily put screen -r (or -R or -x) in your .profile so you don't even have to type it when you log in. –  Ladadadada Aug 6 '12 at 8:06
    
Makes logging out a bit tricky, though. –  womble Aug 6 '12 at 8:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.