I can't get ssh server to run, I've done this a hundred times. What is going on?
I can't start sshd daemon on my new Fedora 21 system, I've done this a hundred times, but it won't start. This is what I've tried:
user@HOST ~$ sudo yum reinstall openssh
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package openssh.x86_64 0:6.6.1p1-11.1.fc21 will be reinstalled
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Reinstalling:
openssh x86_64 6.6.1p1-11.1.fc21 updates 438 k
Transaction Summary
================================================================================
Reinstall 1 Package
Total download size: 438 k
Installed size: 1.4 M
Is this ok [y/d/N]: y
Downloading packages:
openssh-6.6.1p1-11.1.fc21.x86_64.rpm | 438 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction (shutdown inhibited)
Installing : openssh-6.6.1p1-11.1.fc21.x86_64 1/1
Verifying : openssh-6.6.1p1-11.1.fc21.x86_64 1/1
Installed:
openssh.x86_64 0:6.6.1p1-11.1.fc21
Complete!
sudo service sshd start
Redirecting to /bin/systemctl start sshd.service
sudo systemctl start sshd
But this is always the output:
~$ ps aux | grep sshd
user 11227 0.0 0.0 113004 2296 pts/2 S+ 18:34 0:00 grep --color=auto sshd
No sshd running on the system, I never seen this before.
EDIT #1
As noted I've done this hundred of times, this is my configuration and more what I've tried:
root ~ # yum list installed openssh-server
Loaded plugins: langpacks
Installed Packages
openssh-server.x86_64 6.6.1p1-11.1.fc21 @updates
root ~ # ssh -p 22 username@localhost
ssh: connect to host localhost port 22: Connection refused
root ~ #
EDIT #2
I FOUND OUT WHAT THE PROBLEM WAS, I tried to setup(with out looking at any tutorial) the listen address in sshd_config but did it wrong, when I commented out that line, it worked as normal.
Could you tell me/show me a little how the listen address is setup in the config file?
Did you run the service:
systemctrl start sshd.service normally you do not need to add the port how ever will recomend to add verbose so you can see what is the issue
ssh -v user_name@localhost
also check if the service is all on your firewall
sudo firewall-cmd --list-services
Response should be something like:
dhcpv6-client samba-client ssh
see ssh is there if not then add it with
firewall-cmd --add-port=22/tcp if you require permanent add --permanent
ListenAddress is comment out if you like it to listen to all address comment it out or set it to 0.0.0.0 if you want it to listen to one specific ip then you need it there for instance 127.0.0.1 will do localhost
@aeperezt Do you mind editing out my user name in the ssh command in your comment, if you will I will also edit my question, I didn't mean to have that in there.
@aeperezt I will take a look at listenAddress in ssh, I was going to start using that. As it brings strong security. If I'm not mistaking.
@aeperezt Thank's for the attention, I'll figure it out. I'm going to find an tutorial/manual on sshd_config and set listenaddress the right way. Thank's alot.