Re: Arriving at a specified directory instead of the user's home



On Mar 21, 2:28 pm, bejo...@xxxxxxxxx wrote:
Hi!

Can I somehow tell ssh to land in a different directory than the home
of the user? I.e., something like this:

ssh -target-dir=/local/cooldir me@themachine
->
me@themachine:/local/cooldir #

or if I could get ssh not to logout after performing a command, that
would be good, too, because the command could be a 'cd':

ssh -dontlogout me@themachine "cd /local/cooldir"

(Just to avoid confusion: the options "-target-dir" and "-dontlogout"
don't actually exist... unfortunately :) )

I am using this version: OpenSSH_4.2p1, OpenSSL 0.9.8a 11 Oct 2005

Can anyone help with this, please?

Thanks,
Agoston

If you have your keys setup something like this can be achieved
using..

ssh <srvrname> "echo 'cd <somedir>' >> .profile(orwhatever .dotfile)";
ssh <srvrname>

make sure to remove the added last line in your dotfile if you dont'
want it to be permanent..


.



Relevant Pages

  • Re: Really need help on this one
    ... Is there a way to read the output of a particular command into ... Heres a better example using ssh. ... set timeout $timeout ... exec kill -9 $pid ...
    (comp.lang.tcl)
  • RE: midnight commander and ssh sftp
    ... midnight commander and ssh sftp ... which is displayed at the bottom of the MC panel. ... "Left file command options right" at the top of the MC ... MC SSH session with the remote host by hitting F10 key. ...
    (freebsd-questions)
  • Re: [Info-ingres] problems with ssh
    ... Check the SSHD log on the server for errors. ... ancient version of SSH, unfortunately. ... the command seems to have functioned - but just wont terminate and leaves a process hanging around. ... Duckman: You got anymore of those glues? ...
    (comp.databases.ingres)
  • Scripts using SSH and SSH_ASKPASS
    ... To test SSH scripts you better destroy the control TTY. ... The trick is to run YOUR script on YOUR local ... As for the password relaying command: this needs not be an X command. ... # we read one line from a temporary pipe. ...
    (comp.security.ssh)
  • Re: embedding sshd into a server
    ... Right now it listens on a ... Copy the normal ssh config files to a new "privatessh" config: ... A simple way to force a certain command is to change ...
    (comp.security.ssh)