Include directory with subdirectories in SSH configuration: issue with autocomplete

Viewed 130

I am running OpenSSH 8.2 on Ubuntu 20.04. I would like to structure my .ssh/config file so that it includes directories with subdirectories:

Include config.d/*
Include config.d/dir1/*
Include config.d/dir2/*
Include config.d/dir3/*

If I have a host remotevm and I try the autocompletion when I type ssh remotevm, I get the following error:

$ ssh remosed: read error on /home/user/.ssh/config.d/dir1: Is a directory
sed: read error on /home/user/.ssh/config.d/dir2: Is a directory
sed: read error on /home/user/.ssh/config.d/dir3: Is a directory
awk: read error (Is a directory)

What can I do so that the autocompletion works again like before?

Best regards

1 Answers

Specify in Include every single file without folders, like this:

Include config.d/myfile1.conf
Include config.d/dir1/myfile2.conf
Include config.d/dir1/myfile3.conf

To be more precise this has nothing to do with the wildcard itself

It will work like this:

Include config.d/myfile1.conf
Include config.d/dir1/*

The first line of your example includes folders, that's not supported.

Related