how to ssh to the remote path?
ssh user@server -t "cd /some/directory; bash --login"
-
-t
keeps up the connection if there is user interaction) - the "command" is in quotes
-
bash --login
is required to keep up the connection after thecd
(see-t
)
I think you are mixing scp and ssh
For ssh you do not need to specify the destination path. You just log in as [email protected] and you land into the user's home folder.
SSH expects the following syntax:
ssh [other_options] [user@]hostname [command]
so when you typed:
ssh [email protected]:~/apps/
SSH understood that you want to connect to a host named "abc.com:~/apps/" with a user "user". Since that host does not exist, you receive the error you quoted.
You will have to break your command into two like this:
ssh [email protected]
(type the password, and wait for ssh to log you in)
cd ~/apps/
Edit: You can always ssh as [email protected] and then just navigate to the desired folder using cd folderName
Ozair Kafray explained it better