Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name or service not knownname <hostname> #27

Open
lukashevich-t opened this issue Dec 7, 2023 · 8 comments
Open

Name or service not knownname <hostname> #27

lukashevich-t opened this issue Dec 7, 2023 · 8 comments

Comments

@lukashevich-t
Copy link

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

@vaniacer
Copy link
Owner

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?

@Timo1979-x
Copy link

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.

@Timo1979-x
Copy link

Timo1979-x commented Dec 11, 2023

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

@007revad
Copy link

@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

@007revad
Copy link

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
Copy link
Owner

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

Yep

@vaniacer
Copy link
Owner

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

@007revad
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants