Hi, I'm using ssh-config files (usually found in ~/.ssh/config) I'd be happy to see syntax highlighting available on github for this. I did not take the time to see how this could be done yet. Sometimes I share ssh configs in wikis.
https://github.com/github/linguist/blob/master/CONTRIBUTING.md#adding-a-language
There's a grammar available here:
https://github.com/lalyos/ssh-config/blob/master/grammars/ssh-config.cson
That would be awesome :)
Or let me know if it's already available and I did not see it :+1:
Hi, i see you are using a lot textmate highlights
so here is a good grammar with correct licence
https://github.com/textmate/ssh-config.tmbundle
Thanks
I want to work on this issue , as a Good First Contributor, @GabLeRoux can you give link to any of your repos where you have a sshconfig committed , for testing ?
I don't have a repo, but here's an example of what I have locally in ~/.ssh/config:
# quick handy copy paste
#PreferredAuthentications=password
#PubkeyAuthentication=no
# proxycommand with SOCKS5: https://www.cyberciti.biz/faq/linux-unix-ssh-proxycommand-passing-through-one-host-gateway-server/
# proxycommand: https://starkandwayne.com/blog/setting-up-an-ssh-tunnel-with-ssh-config/
# proxyjump: https://www.madboa.com/blog/2017/11/02/ssh-proxyjump/
# proxyjump: https://wiki.gentoo.org/wiki/SSH_jump_host
# bitbucket
Host bitbucket bitbucket.org
Hostname bitbucket.org
User git
IdentityFile ~/.ssh/bitbucket_rsa
IdentitiesOnly yes
# github
Host github github.com gist.github.com
Hostname github.com
User git
IdentityFile ~/.ssh/github_rsa
IdentitiesOnly yes
# gitlab
Host gitlab.com
Hostname gitlab.com
User git
IdentityFile ~/.ssh/gitlab_rsa
IdentitiesOnly yes
# local test gitlab
Host gitlab.local
Hostname gitlab.local
User git
Port 2222
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
# Router
Host 192.168.1.1 tomato
#Hostname tomato
Hostname 192.168.1.1
IdentityFile ~/.ssh/tomato_rsa
IdentitiesOnly yes
User root
KexAlgorithms +diffie-hellman-group1-sha1
# Some password only server example
Host 192.168.0.100 example
Hostname 192.168.0.100
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
User root
PreferredAuthentications=password
PubkeyAuthentication=no
# Example server
Host client-roomserver01
Hostname 255.255.255.255
User root
Port 22
IdentitiesOnly no
PreferredAuthentications=password
#ProxyCommand ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no client-proxy-server nc %h %p %r -e
#ProxyCommand ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no client-proxy-server nc %h %p
ProxyJump client-proxy-server
# Some vagrant box
Host client-vagrant
HostName 127.0.0.1
User vagrant
Port 2200
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /Users/gableroux/somewhere/.vagrant/machines/default/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
# Example ProxyCommand
Host client-roomserver02
Hostname 255.255.255.255
User root
Port 22
IdentitiesOnly no
PreferredAuthentications=password
ProxyCommand ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no client-proxy-server nc %h %p %r -e
ProxyCommand ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no client-proxy-server nc %h %p
#ProxyJump client-proxy-server
edit: updated to use ssh-config backtick shorthand
Here you go mate. I smashed together an SSH config you can use. The grammar repository is already added to Linguist (vendor/grammars/language-etc), so you'll simply need to update the submodule locally. 馃憤
@atakanyenel Go for it! 馃槈
You guys will start seeing highlighted SSH-configs on GitHub.com once the next release of Linguist has been cut.
What's the backtick shorthand for this?
Will this work?
~~~
Host my-nickname
Hostname my-nickname.example.com
User me
~~~
Hmm... let's see
sshconfig:
Host my-nickname
Hostname my-nickname.example.com
User me
ssh-config:
Host my-nickname
Hostname my-nickname.example.com
User me
ssh_config:
Host my-nickname
Hostname my-nickname.example.com
User me
sshdconfig:
Host my-nickname
Hostname my-nickname.example.com
User me
sshd-config:
Host my-nickname
Hostname my-nickname.example.com
User me
sshd_config:
Host my-nickname
Hostname my-nickname.example.com
User me
Looks like ssh-config is the winner.
Most helpful comment
Backtick Shorthand
What's the backtick shorthand for this?
Will this work?
~~~
~~~
Testing...
Hmm... let's see
sshconfig:ssh-config:ssh_config:sshdconfig:sshd-config:sshd_config:Result
Looks like
ssh-configis the winner.