LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Setting up SSH server (http://www.linuxquestions.org/questions/linux-server-73/setting-up-ssh-server-704538/)

SuperDude123 02-13-2009 08:42 PM

Setting up SSH server
 
Well, after corrupting my Damn Small Linux, I am now installing a fresh copy of Debian.

My question is, what is the fastest way to get my box as a SSH server up and running?

I also think I need to do the following:

A) So far, I know that I need to have SSH installed, how do I do that with Debian?

B) Once I modify the sshd_psswd file, how or do I need to generate keys?

C) Am I missing anything?

anomie 02-13-2009 10:13 PM

Quote:

Originally Posted by SuperDude123
A) So far, I know that I need to have SSH installed, how do I do that with Debian?

If I were interested in learning Debian, I think I'd bookmark, and read through, the following two resources:
But, I don't know Debian. That's just how I would approach it. I am sure you can figure out how to operate their package manager by reading those.

Quote:

Originally Posted by SuperDude123
B) Once I modify the sshd_psswd file, how or do I need to generate keys?

If you're referring to host identification keys, they're generated for you automatically the first time you launch sshd. If you're referring to rsa/dsa keys (i.e. for Pubkey Authentication), that requires a little more effort. Search the 'net for "ssh pubkey authentication". Setting these up are only necessary if you intend to authenticate that way.

Quote:

Originally Posted by SuperDude123
C) Am I missing anything?

We don't know. :) Get started on the right foot, and read that documentation. It will actually save you lots of time in the long run.

SuperDude123 02-13-2009 10:17 PM

Ok, I got the service installed, and I modified the sshd_config file, but the problem is, I can't ssh in. What could cause this?

AlucardZero 02-13-2009 10:30 PM

Never heard of a sshd_psswd file.

8,997 different things. Is SSHD running?

SuperDude123 02-13-2009 10:33 PM

Opps, I meant the sshd_config file.

How do I start SSH? I keep trying to do /etc/init.d/ssh start as root, but all I get is

Starting OpenBSD Secure Shell server: sshdserver:/etc/init.d

AlucardZero 02-13-2009 10:50 PM

What do
Code:

ps -ef | grep ssh
(as root)
Code:

netstat -anp | grep ssh
say

SuperDude123 02-13-2009 11:00 PM

I just noticed that when I load the system, I get the following prob:

Starting OpenBSD Secure Shell server: sshdCould not load host key: /etc/ssh/ssh_host_key
Disabling protocol version 1. Could not load host key


Concerning ps -ef | grep ssh, I get

root 1822 1 0 22:05 ? 00:00:00 /usr/sbin/sshd
root 1954 1949 0 22:09 tty1 00:00:00 grep shh

netstat -anp | grep ssh

tcp 0 0 0.0.0.0:8812 0.0.0.0:* Listen 1822/sshd

Now I see that we can see that I moved my port 22 to 8812

AlucardZero 02-13-2009 11:23 PM

Disabling protocol 1 is good. 2 is better. What's the error when you try to SSH in?

SuperDude123 02-13-2009 11:29 PM

When I do "ssh root@192.168.0.196 -p 8812" on my mac, I get "ssh: connect to host 192.168.0.196 port 8812: Connection refused"

I did try running ssh -v start and the last line gave me a "ssh: start: Name or service not known"

Also, what should my rules in sshd_config look like if I plan to do user name and password log in? I did however manage to disable the protocol 1 stufff by placing a # in front.

SuperDude123 02-14-2009 12:02 AM

Well I solved my prob. I guess I was SSHing the wrong IP, so I was SSHing my mac, where the firewall was stoping me all the time. Thanks guys!


All times are GMT -5. The time now is 03:11 AM.