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

Connecting to Host "My Server" fails from non-default location config #106

Open
miconda opened this issue Aug 28, 2024 · 0 comments
Open

Comments

@miconda
Copy link

miconda commented Aug 28, 2024

If the value of Host is not resolvable or has special characters (w.g., whitespace), sshs fails to connect if the config is provided by -c. For example, if I have a ssh.config in a temporary folder that contains:

Host "My Server"
	HostName 10.1.1.10
	User ubuntu

Ans start sshs -c ssh.config, selecting My Server, the result is:

Running command: ssh "My Server"
hostname contains invalid characters

If the Host is MyServer, which is not resolvable, the result is:

Running command: ssh "MyServer"
ssh: Could not resolve hostname myserver: nodename nor servname provided, or not known

If the same host block is placed in the ~/.ssh/config file, connection is established by starting just sshs.

It seems to work by providing -F ssh.config to the command template makes it work, but I am not sure if it is the right fix:

sshs -t "ssh -F ssh.config \"{{{name}}}\"" -c ssh.config

If it is, I think it should be made the default command template, otherwise using -c is not very useful.

Btw, is the list of sshs keywords that can be used in the command template available somewhere? Or is only name? I tried hostname, but the result was empty string.

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

1 participant