Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use the -N flag in my ssh config file, but I'm not sure how to do this?

Is it possible?

 -N      Do not execute a remote command.  This is useful for just for‐
         warding ports (protocol version 2 only).


Host foo
    HostName foo.bar.com
    User baz
    <how can I add -N flag here?>
share|improve this question
    
Sounds like a case of the XY problem. What exactly do you want to do? – terdon Dec 13 '12 at 16:02
    
@terdon I am trying to pass the -N flag to ssh for a gitolite server my work has that appears to be slow during push/pull. I was told this will stop ssh from executing a shell on startup and loading the environment and stuff which is contributing to the lag I'm experiencing. – veilig Dec 13 '12 at 16:37
    
Why don't you just run ssh -N, why do you need to set this as a config parameter? – terdon Dec 13 '12 at 16:43

Which OS? Do a man ssh_config and see if your ssh has such an option. On linux it this option is not available as a config parameter. As far as I know, I think the same is true with other openssh or similar clients in other platforms.

share|improve this answer
    
Ubuntu 12.04, I looked at the ssh_config man page but unless I overlooked it I didn't see it possible. – veilig Dec 13 '12 at 16:34

actually -N is not a parameter but just a flag like -l or else

if you don't want to have command ssh -N -l username HOSTNAME you can create alias ssh = "ssh -N" (on the host from where you want to ssh to your gitolite server.

another idea that came to my mind , the slowness of ssh can be because of DNS also, on connection server is trying to resolve hostname of machine which is trying to connect and if there are a wrong entry in DNS or no info available it will become slow on connection

kinds

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .