question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuration like ~/.ssh/config

See original GitHub issue

By using the ~/.ssh/config file on my PC, ssh can be configured to allow easy and quick connections to remote servers by simply typing a hostname, e.g. ssh my-server-1 and all configuration is taken from the ~/.ssh/config file.

I would like to have a similar way to configure mssh so that I could just do mssh my-server-2 and the ID, username, and profile is taken from the config file. The syntax could be the same, e.g.

# ~/.mssh/config
Host my-server-2
  User ubuntu
  Id i-04be40ce96fd3f85
  Profile my-profile
  AvailabilityZone eu-central-1b
  Region eu-central-1b

As we have a quite a lot of servers this is a function I am missing at the moment compared to using SSH directly.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:34
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lkolchincommented, Jul 23, 2020

To expand on that. It’d be nice to even use the same ssh config file or at least being able to script SSH via SSM tunneling similar to:

Host *
TCPKeepAlive yes
ServerAliveInterval 30
ConnectTimeout 10

host i-*.* mi-*.*
  ProxyCommand bash -c "aws ssm start-session --target $(echo %h|cut -d'.' -f1) --region $(echo %h|/usr/bin/cut -d'.' -f2) --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
  User ec2-user
host i-* mi-*
  ProxyCommand bash -c "aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
  User ec2-user

Then you would just:

mssh ec2-user@i-0ded1d8c2282ee39e.ap-southeast-2

or

mssh i-0ded1d8c2282ee39e.ap-southeast-2
1reaction
CptTZcommented, Apr 2, 2020

Any word on this?

This feature request is already in our backlog. I will update here once we have more info on it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the SSH Config File | Linuxize
OpenSSH client-side configuration file is named config , and it is stored in the .ssh directory under the user's home directory.
Read more >
SSH config file for OpenSSH client
The ssh program on a host receives its configuration from either the command line or from configuration files ~/.ssh/config and /etc/ssh/ssh_config .
Read more >
SSH configuration | ssh_config - Teleport
This blog post covers some of my favorite settings for configuring the behavior of an ssh client (i.e. what is in the man...
Read more >
OpenSSH Config File Examples For Linux / Unix Users - nixCraft
/etc/ssh/ssh_config : This files set the default configuration for all users of OpenSSH clients on that desktop/laptop and it must be readable ...
Read more >
How To Configure Custom Connection Options for your SSH ...
OpenSSH, the most commonly used command-line SSH client on most systems, allows you to provide customized connection options. These can be saved ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found