Remote Command usage problem

Hi,
When I tri to add an RemoteCommand in avanced tab I have an error and unable to connect to ssh.
I want to change directory after connection is established so I added this in RemoteCommand:
cd /vmfs/volumes/datastore1

but I have this error when trying to connect :
load pubkey "/Users/.../Library/Group Containers/E78WKS7W4U.io.coressh.ssh/.ssh/privatekey/...": invalid format
If i change the command for "who" by eg, I have the result but imediatly disconnected after...

if I remove the command everything work correctly.... How can solve this ? Thanks.

In ssh man page:

If a command is specified, it is executed on the remote host instead of a login shell.

If you want to keep the interactive shell after remote command executed, you should specify RemoteCommand to something like this:

image

Replace ls; pwd to whatever command you'd like.

1 Like