Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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
share|improve this answer
    
and you are probably right (as always) :) –  Bruno Pereira Feb 20 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 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 at 10:43
    
Thanks for that too. Now it's there. –  Norman Feb 20 at 10:50

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

it is basically OpenSSH SSH daemon configuration file

share|improve this answer
    
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 at 9:58
    
yes u can just make sure you write it properly.. –  smn_onrocks Feb 20 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! –  Bruno Pereira Feb 20 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 at 10:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.