gnachman created page: scp not connecting authored by George Nachman's avatar George Nachman
...@@ -12,7 +12,7 @@ There are a few ways these features can fail. ...@@ -12,7 +12,7 @@ There are a few ways these features can fail.
## Is shell integration installed? ## Is shell integration installed?
If you see a blue arrow in the margin to the left of your prompt on the remote host you can skip this section. If you see a blue arrow in the margin to the left of your prompt on the remote host you can skip this question.
Shell integration must be installed on every remote host you use and every user you log in as. If you only install it on your mac, iTerm2 won't know that you've ssh'ed somewhere, so it doesn't know what host to connect to. When you ssh to the remote host, select the menu item *iTerm2 > Install Shell Integration*. Then log out and log back in again. Shell integration must be installed on every remote host you use and every user you log in as. If you only install it on your mac, iTerm2 won't know that you've ssh'ed somewhere, so it doesn't know what host to connect to. When you ssh to the remote host, select the menu item *iTerm2 > Install Shell Integration*. Then log out and log back in again.
...@@ -26,7 +26,9 @@ The shell integration script currently uses the `hostname -f` command to guess y ...@@ -26,7 +26,9 @@ The shell integration script currently uses the `hostname -f` command to guess y
### Diagnosis ### Diagnosis
To determine the hostname we have guessed, set *Prefs > Profiles > General > Badge* to `Hostname is \(session.hostname)`. You'll see the text *Hostname is example.com* in the top right of your terminal. If ssh'ing to *example.com* from your mac would not succeed, that is your problem. To determine the hostname we have guessed, right click on a file name while `ssh`ed. You should see a menu item titled **Download with scp from _hostname_**. If _hostname_ is not reachable from your Mac, that's your problem.
If the menu item is grayed out, you either don't have shell integration installed or the remote host's `hostname -f` returned `localhost` or the same output as `hostname -f` when run on your Mac.
### How can I override the hostname? ### How can I override the hostname?
...@@ -50,6 +52,10 @@ You have to install shell integration in root's login script, too. I bet you don ...@@ -50,6 +52,10 @@ You have to install shell integration in root's login script, too. I bet you don
There is a workaround. You can define a trigger to tell iTerm2 what your username and hostname are for times when installing shell integration is not an option. Define a trigger that fires when you become root. Set the action to *Set User & Host*. Set the parameter to `root@example.com` (replacing *example.com* with your hostname, of course). There is a workaround. You can define a trigger to tell iTerm2 what your username and hostname are for times when installing shell integration is not an option. Define a trigger that fires when you become root. Set the action to *Set User & Host*. Set the parameter to `root@example.com` (replacing *example.com* with your hostname, of course).
## I have to ssh through an intermediate host; I can't connect directly from my Mac.
I'm not aware of a satisfactory answer here. You could use ssh agent forwarding, but it has security issues.
## Is something else up? ## Is something else up?
Informative logs are written to `/var/log/system.log` when you use iTerm2's secure copy feature. Have a look at what is written there to get a clue of what else might be going on. If you file an issue, please include this information. Informative logs are written to `/var/log/system.log` when you use iTerm2's secure copy feature. Have a look at what is written there to get a clue of what else might be going on. If you file an issue, please include this information.