vaniacer/sshto

Name or service not knownname <hostname>

Opened this issue · 8 comments

my ~/.ssh/config looks like this:

Host *
ForwardAgent yes
ServerAliveInterval 120
IdentityFile /path/to/default/default/ssh/key
...
Host gate
User tim
Hostname 1.2.3.4
Port 22
LocalForward 1234 192.168.1.1:1234

after running sshto and selecting host gate I got error: Name or service not knownname gate

my default shell is zsh. But I run /bin/bash before starting sshto. I use Linux Mint 21.2

I'm not familiar with zsh but sshto has this shebang: #!/usr/bin/env bash so it should work as bash unleas you've started it in some fancy way. Are you trying to connect to this host? It's basically ssh gate is this working in your shell? Paths problem?

no, I don't use any "fancy way" to run your script. just 'sshto'
'ssh gate' works like a charm.
As I know, you are russian speaking man, so lets continue in russian.

@vaniacer
I'm not criticizing your script, but I'm curious if you've ever checked sshto.sh with shellcheck?

When I pasted your sshto script into shellcheck.net it output about 15 pages of info, suggestions, warnings and errors.

Then I told shellcheck to ignore all the info and suggestions by adding the following under the shebang:

#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2317,SC2007,SC2086,SC2059,SC2004,SC2029,SC2031,SC2030,SC2028,SC2012,SC2015

That left just 3 errors and 28 warnings. 2 of the warnings relate to $hostname

https://habr.com/ru/articles/661687/ Is it your article?

It's got Ivan's name at the top of the article: vaniacer 19 апр 2022 в 19:26

@vaniacer I'm not criticizing your script, but I'm curious if you've ever checked sshto.sh with shellcheck?

When I pasted your sshto script into shellcheck.net it output about 15 pages of info, suggestions, warnings and errors.

Then I told shellcheck to ignore all the info and suggestions by adding the following under the shebang:

#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2317,SC2007,SC2086,SC2059,SC2004,SC2029,SC2031,SC2030,SC2028,SC2012,SC2015

That left just 3 errors and 28 warnings. 2 of the warnings relate to $hostname

I wonder how many errors/warnings will be in piu-piu )
I don't use shellcheck on my own scripts, coz there are a lot of tests, tries, rewrites ... during script creation process.
But yeah it's a nice tool.

I wonder how many errors/warnings will be in piu-piu )

shellcheck.net refused to process it because it's too large. It does the same with one of my scripts that was 2000 lines.