Questions tagged [ssh-config]

83 questions
36
votes
2 answers

Correct ssh config file settings to tunnel to a 3rd machine

I'm trying to tunnel to a server via a bridge server. So far, I've been able to get it working from the command shell properly using the following command: ssh -A -t [email protected] ssh -A [email protected] But I've…
Eric B.
  • 635
  • 2
  • 7
  • 11
29
votes
3 answers

Remote command in ssh config file

I'd like to set ssh_config so after just typing ssh my_hostname i end up in specific folder. Just like I would type cd /folder/another_one/much_much_deeper/. How can i achieve that? EDIT. It's have been marked as duplicate of "How to ssh into…
Kazz
  • 393
  • 1
  • 3
  • 6
21
votes
5 answers

How to configure SSH with a RemoteCommand only for interactive sessions (i.e. without command, or not sftp)

Currently I use Fish as my main shell on local and remote hosts. I connect to remote hosts via ssh and sftp. I wanted to open or reuse a remote tmux whenever I connect, automatically, by default; so I added this to my ~/.ssh/config: Host…
Yajo
  • 393
  • 1
  • 4
  • 8
19
votes
3 answers

What is the .ssh/config corresponding option for ssh -N

I want to set up an alias in my config file that has the same result as this command: ssh -N devdb -L 1234:127.0.0.1:1234 My .ssh/config entry for devdb: Host devdb User someuser HostName the_hostname LocalForward 1234 127.0.0.1:1234 What do I…
mikeb
  • 328
  • 2
  • 8
14
votes
2 answers

How to forward a range of ports in ssh config?

I understand that I can forward multiple port in ssh config file by: Host name HostName yam.myHost.edu User myUserName LocalForward 5901 127.0.0.1:5901 LocalForward 5902 127.0.0.1:5902 [...] LocalForward 5910…
M.Reza
  • 241
  • 1
  • 2
  • 5
9
votes
1 answer

Using SSH to connect to a new server without storing the host keys in the $HOME/.ssh/known_host file

I get the following output if I run the following command: -bash-3.2$ ssh -o "StrictHostKeyChecking no" 192.168.1.77 Warning: Permanently added '192.168.1.77' (RSA) to the list of known hosts. Last login: Fri Jul 4 10:49:11 2014 from…
Warwick
  • 1,620
  • 12
  • 16
8
votes
4 answers

How to bypass RemoteCommand option in ssh_config

I have defined a ssh_config file with all the hosts to which I connect on a regular basis. I like to start/connect to a tmux session upon connection to the host, so I've added the line RemoteCommand tmux new -ADs remote in my config. The problem is…
qmeeus
  • 203
  • 2
  • 7
8
votes
1 answer

Specify Specific Identity file when ssh'ing as certain user in ~/.ssh/config

I would like to specify a specific identity file based on the user I am ssh'ing as to a server. For example when ssh as user1 from host 1 to host 2 as user1 [user1@host1 ~]$ ssh user1@host2 I would like to use a certain identity file. However when…
Tyler R
  • 183
  • 1
  • 5
8
votes
1 answer

Only apply Match keyword to single Host in ssh config

I have a host which I ssh into. Sometimes I'm inside the same network, and can ssh directly into it, other times I'm outside it and I need to use a proxy. Because ssh via the proxy server is much slower than direct, I'd like to have my ssh config…
James Tocknell
  • 484
  • 1
  • 4
  • 13
7
votes
1 answer

Midnight Commander: sftp connection using aliases from ssh config

Problem description I try to connect to remote server in one of two panels of Midnight Commander using SFTP link... submenu. Unfortunately, mc does not pass my ~/.ssh/config file to sftp. Therefore typing sftp://myhostalias results in error message…
pch
  • 241
  • 2
  • 6
7
votes
2 answers

How to reset the sshd_config file to its default settings

I have changed some stuff within the sshd_config file and want to reset the file to its default settings. How would I go about doing this?
StrangeRanger
  • 583
  • 2
  • 5
  • 16
5
votes
1 answer

In ssh config, what does `Match canonical all` mean?

I wanted to use CanonicalizeHostname in my ssh config which would make it possible to add and remove hosts without having to edit the file. Host bastion ProxyJump none Match canonical ProxyJump bastion ForwardAgent yes Host * …
paradroid
  • 1,159
  • 1
  • 13
  • 28
5
votes
2 answers

How to generate a certificate file which to be used with ssh config?

I have a configuration as below in my ~/.ssh/config file: Host xxx HostName 127.0.0.1 Port 2222 User gigi ServerAliveInterval 30 IdentityFile ~/blablabla # CertificateFile ~/blablabla-cert.pub which works fine but I'm…
Adrian
  • 659
  • 1
  • 7
  • 29
5
votes
2 answers

ssh_config Host * overrides earlier host

Im trying to make my .ssh/config support different ssh keys for the same host so that I can commit to bitbucket as either my personal or work user, and other ssh stuff still uses my work user. My config file looks like this: Host bitbucket-personal …
undefined
  • 151
  • 1
  • 4
5
votes
1 answer

ssh-copy-id versus manual copy id_rsa.pub

From one day to another, our company server started to ask me for my SSH password. First thing that I checked was to see if my key was inside .ssh/authorized_keys on the server. My key was inside, nothing changed. Also in /etc/ssh/sshd_config…
spaceman117X
  • 370
  • 2
  • 6
  • 17
1
2 3 4 5 6