Inside here documents where the delimiter after `<<` (here `EOF`) is not quoted, the `<backslash><newline>` sequence is removed, that's a _line continuation_. Actually, the only cases where `<backslash><newline>` is not removed is: - inside single quotes - inside here documents where the delimiter is quoted - where the backslash itself is quoted (`<backslash><backslash><newline>`) <b></b> cat << EOF foo\ bar EOF outputs foobar So, here you can do: ssh user@server << EOF command_one command_two argument1 argument2 argument3 argument4 \ argument5 argument6 argument7 command_three EOF And `ssh` will end up being fed: command_one command_two argument1 argument2 argument3 argument4 argument5 argument6 argument7 command_three On its stdin. Even if you used: `ssh ... << 'EOF'` so as to avoid variables, command substitutions and arithmetic expansion being performed inside the here-document, `ssh` would be fed: command_one command_two argument1 argument2 argument3 argument4 \ argument5 argument6 argument7 command_three But the remote shell would interpret that `<backslash><newline>` as a line continuation, so it would have the same effect. Note that when you do: ssh user@host << EOF `sshd` on the remote host runs the user's login shell to interpret that code. Since it could be anything, not necessarily a Bourne-like shell, it may be better to run: ssh user@host sh << EOF Where `sshd` runs `user-s-login-shell -c sh`, so you know a Bourne-like shell is interpreting your code. A significant difference though is that in that case, `user-s-login-shell` is not started as a login shell so won't read `/etc/profile` or `~/.profile` (or the equivalent for the user's login shell) to set the login session up.