2

I just finished installing Ubuntu Server 12.04.4 and was setting up ssh.

When I did $ sudo vi etc/ssh/sshd_config

I get something with no lines and the words [New Directory]

Is this the way it should be? My ssh_config file is ok. There's text in it.

Did I go wrong anywhere? How do I set this right?

1
  • LOL, I've stumbled upon this question for the 3rd time in last 24 hours, because I actually get empty /etc/ssh/sshd_config after reinstalling Ubuntu 16.04!
    – tishma
    Oct 9, 2019 at 9:07

2 Answers 2

5

I think the problem is a bit more simple than currently being suggested. Look at your command again:

sudo vi etc/ssh/sshd_config

There's no leading /. That means vi is trying to open <current-path>/etc/ssh/sshd_config so unless you're at /, it won't work.

The fix is to just specify the proper path:

sudo vi /etc/ssh/sshd_config
3
  • and you are probably right (as always) :) Feb 20, 2014 at 10:34
  • Thanks for that Oli. Now it's there. I can see the sshd file's contents. But the ssh_config is gone. I'll reinstall Ubuntu.
    – Norman
    Feb 20, 2014 at 10:39
  • Or you could just reinstall the right package with its config: sudo apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall openssh-client
    – Oli
    Feb 20, 2014 at 10:43
-2

Yes it is absolutely normal there is nothing to do with it.. no worry..

it is basically OpenSSH SSH daemon configuration file

4
  • So when I need to add rules like AllowUsers tom jerry do I add them to the ssh_config file or the sshd_config file
    – Norman
    Feb 20, 2014 at 9:58
  • yes u can just make sure you write it properly.. Feb 20, 2014 at 10:00
  • 1
    This is not true, after installing the ssh server the configuration file is not empty and you do not need to write everything by hand, it comes pre-configured! Feb 20, 2014 at 10:05
  • @maythux well, it does provide answer, even though it's wrong. In that case, downvoting is the right approach.
    – Olli
    Feb 20, 2014 at 10:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .