Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ssh-config]

The tag has no usage guidance.

0
votes
1answer
25 views

Generating a ssh Host config file out of a Supperputty XML file

I am building a script that generates an ssh config file out of a Supperputty XML Session config file. I don't know which tool could handle it better. I try to achieve it with awk, but I don't receive ...
2
votes
1answer
69 views

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 endava HostName 127.0.0.1 Port 2222 User gigi ServerAliveInterval 30 IdentityFile ~/blablabla # CertificateFile ~...
1
vote
1answer
41 views

ssh bash completion : sed: -e expression #1, char 97: invalid reference \2 on `s' command's RHS

I'm using Ubuntu 14.04.5 LTS. The ssh bash completion on any Host of the file ~/.ssh/config does not work : $ ssh b2sed: -e expression #1, char 97: invalid reference \2 on `s' command's RHS The ...
0
votes
0answers
20 views

Having multiple ssh config files deny bash auto complete for ssh

I'm using MacOS Mojave 10.14.2 Running on iTerm2 Build 3.2.6 I'll simplify the problem here. Let's say I have ssh config file which only includes other ssh config files. How can I make the terminal ...
1
vote
0answers
171 views

SSH config file - Run command before connection

i cannot run a command before connect with ssh to remote server using ~/.ssh/config file. I have tried with options "ProxyCommand" and "LocalCommand" but it doesn't work. ProxyCommand: seems it run ...
1
vote
1answer
116 views

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 ...
0
votes
1answer
65 views

What's the equivalent ssh config of this ssh tunnel command?

I have a host2 remotely forwarding its ssh connection to port 2222 on host1. I am using the following command on host0 to connect to host2 via host1. ssh -tt host1 ssh -p 2222 localhost Is there an ...
0
votes
1answer
104 views

How to use backslash in user on ~/.ssh/config

So my university supplied access to a server with backslashes, like this: ssh portoalegre\\15280433@university.server.br and I decided to copy my public key there to be more secure (and not having ...
0
votes
1answer
69 views

Repeated prompts for SSH private key password in single session

I have a private SSH key on a shared development server, which is secured with a password. Even after loading it into ssh-agent, I get re-prompted for the private key password For some reason, even ...
0
votes
2answers
199 views

mux- prefix in ssh ControlPath with Bastion server

I am looking at different samples for configuring ssh config to support Bastion connection to my cloud's internal servers. I'v hae encountered several (working) samples having the prefix "mux-" on ...
1
vote
1answer
194 views

Is it possible to have conditional options in ~/.ssh/config based on the calling application (ssh or sshfs)?

In my ~/.ssh/config file I have the following option: RemoteCommand /bin/sh -c 'tmux has-session && exec tmux attach || exec tmux' This automatically starts tmux and connects to an existing ...
2
votes
3answers
346 views

Put `ForceCommand` in a user-specific configuration file

I'm trying to restrict an SSH-tunnel user. # sudo cat /home/user/.ssh/config Banner none ChrootDirectory /home/%u PasswordAuthentication no AllowTcpForwarding yes X11Forwarding no ...
1
vote
0answers
609 views

ssh does not recognize host name defined in config file [closed]

My ssh can no longer resolve my hostname. Everything was working fine until I did a security update on my ubuntu v16.04. I try to do ssh <myhost> and receive the error ssh: Could not resolve ...
1
vote
1answer
247 views

Force PTY allocation in ssh_config

To run interactive programs remotely one should use ssh -t <host>. But this -t option also has drawbacks so it's not good to use it on non-interactive programs. My problem is: I have several ...
2
votes
2answers
686 views

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 ...
0
votes
3answers
802 views

ssh config identities specified by IdentityFile are not forwarded by ForwardAgent

I work in an environment where I have multiple ssh keys for multiple environments, all of which utilize a bastion host, meaning to ssh to any box in any environment, it is a 2-step hop, first to the ...
2
votes
0answers
119 views

How do I define an alternate fallback in ~/.ssh/config?

I have a number of entries in ~/.ssh/config: Host github.com Hostname github.com User git IdentityFile ~/.ssh/github Host mydomain.com User name IdentityFile ~/.ssh/id_rsa Host full.name@...
1
vote
1answer
2k views

ssh config: alternatives for ProxyCommand?

With the help of ProxyCommand I set up some ssh favorites for ease of use: host some_server hostname some_server port 22 user some_user IdentityFile /home/user/.ssh/id_rsa ...
5
votes
1answer
834 views

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 ...
9
votes
3answers
1k views

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 ...
1
vote
1answer
293 views

How to configure SSH fallback keys for regex

I'm trying to configure my SSH config file to try several different keys and users for a domain. I was using a function in my dotfiles to do this originally but it's unwieldy, slow, and ugly. My ...
1
vote
0answers
703 views

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, ...
-1
votes
1answer
1k views

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 ...
5
votes
1answer
3k views

.ssh/config ProxyCommand with a variable port

In the environment I work in, we use tunnels to SSH to various servers. For example, I'll 'ssh -p XXXXX username@localhost' to reach the server. If the port was always the same, I could do this, ...
2
votes
0answers
2k views

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:...
1
vote
2answers
2k views

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?
9
votes
3answers
4k views

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 ...
3
votes
2answers
962 views

Accessing a git repository through ssh-config

I am trying to push to my git repository from cygwin but in vain. It used to work. I get $ git push ssh: Could not resolve hostname prooftheory: Name or service not known fatal: Could not read from ...
1
vote
3answers
2k views

How to force User in ssh config file

I'm trying to override the User for certain hosts. I came across this gist and though I could improve on it by removing the step of creating a new Host alias for each domain-account needed. ~/.ssh/...
1
vote
1answer
518 views

Scripted manipulation of SSH public keys in the authorized_keys file

The ~/.ssh/authorized_keys file format can be briefly summarised as a text file with one line per key; empty lines and lines beginning with the octothorpe (#) are ignored; there are four fields: ...
2
votes
0answers
78 views

SSH-Config - Is there a way to determine if local or remote?

My ssh-config currently has two entries for each host, one that has the local hostname and one that has the remote address of the host. I'm wondering if there's a way I can combine those two entries ...
1
vote
1answer
576 views

Why does ssh-copy-id need verbose LogLevel to work in this case?

I'm trying to set up public key authentication on a CentOS 7.3 guest, using WSL. When trying to copy the public key using ssh-copy-id, it's rejected, saying it already exists on the VM. This is not ...
0
votes
1answer
523 views

SSH SFTP Only With chroot and command

I try to restrict access to SFTP Only with one User Account. After Login there should some commands be executed.Therefore i inserted forcecommmand in my sshd_config: Match group stream #...
2
votes
2answers
119 views

ssh config from Ubuntu 12.04 doesn't work on 14.04.4

I setup a new Ubuntu 14.04.4 server to replace a 12.04 machine, but the new server is having problems with the old ssh config. I can ssh without the config, and can even ssh through a bastion server ...
3
votes
1answer
139 views

Can not connect through sshfs because a wrong configuration at ~/.ssh/config file

I am logged in in my local PC (Fedora 24) as rperez. From this PC I needed to connect to a remote server through sshfs so I generated a private/public key by running ssh-keygen. Using the following ...
2
votes
1answer
3k views

Multihop with sshpass

I want to use .ssh/config to connect to a host through a gateway. I don't want to set up an RSA key and have to use password. I have previously done this kind of hopping without password. Now trying ...
4
votes
1answer
2k views

SSH with a bastion host and different usernames

I want to log into a linux server using two sequential bastion hosts. My .ssh/config file looks something like this: Host * User username0 Host hostname0 Hostname foo Host hostname1 Hostname ...
1
vote
2answers
5k views

ssh configuration without being asked for password

The goal, here, is to be able to only write ssh 10.0.200.9.switch -l customer from my laptop and be logged in without being asked for password. Switch is located inside local LAN meaning Laptop -->...
4
votes
0answers
2k views

Using ssh -t works but using ProxyCommand ssh -W does not

I am trying to set up a ssh connection through a jump host. It should go like this A -> B -> C. I can connect fine from A to B and from B to C but I would like to have a single connection from A to C ...
1
vote
1answer
359 views

Using shell code for LocalForward in ssh config file

I have this configuration in my ssh config file, Host *+* ProxyCommand ssh $(echo %h | sed -e 's/+[^+]*$//;s/\([^+=]*\)=\([^+]*\)$/\2 -l \1/; s/^\([^+:]*\):\([0-9]*\)+/-p \2 \1+/') -W $(echo %h | ...
3
votes
1answer
349 views

Syntax error with variable containing quotes

I have a bunch of Linux machines behind 2 gateways. To connect to set one I do ssh -o ProxyCommand="ssh gateway1 nc %h %p" machines_behind_1 ssh -o ProxyCommand="ssh gateway2 nc --proxy %h %p --...
1
vote
1answer
1k views

Does the default per user .ssh/config file override all options in system wide ssh_config? [duplicate]

If there is no -F switch and there is an /home/me/.ssh/config file that I can expect the settings in /etc/ssh/ssh_config to be ignored or do the settings in my home directory just supplement the ...
0
votes
1answer
194 views

Impact of removing ssh_config file

Pretty new to Linux here. Trying to get a better grip on the OS.  Here is my problem - I have a question about the impact of removing ssh_config file from a Linux box. I was having some cipher ...
0
votes
1answer
162 views

Rental server refuses SSH connection; won't allow authorise me to download my SSH key

I am attempting to connect to my rental server via ssh to install MemSQL for a project. I have written the following in ~/.ssh/config: HOST eHosts HostName e9.ehosts.com Port 2222 User orderof3 But ...
1
vote
2answers
5k views

ssh algorithm negotiation failed

Problem Ok, the problem is that I am using Pycharm on El Capitan. I am trying to connect to a server that has strict login Kexalgorithms using the newer Key Exchange Algorithms than Pycharm seems to ...
9
votes
2answers
7k views

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 bridge_userid@bridgemachine.com ...
2
votes
2answers
908 views

Use a dynamically obtained hostname with an ssh config entry

Our accounts in our lab are all mounted over NFS and are accessible over all the systems in a subnet. So, effectively we can ssh into any of the machines in the subnet and continue our work. The ...
1
vote
1answer
387 views

ssh config change user for one host

I would like to connect to each server using the root user and to machin server using me user. I edit .ssh/config User root Host machin Hostname machin User me When I type ssh machin I get ...
7
votes
1answer
6k views

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 ...
8
votes
1answer
2k views

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 ...