# ssh problem(connect to host X port X :Connection refused)

## GNUtoo

```
# ssh 192.168.1.108

ssh: connect to host 192.168.1.108 port 22: Connection refused
```

what should i do in the server configuration

the client is under gentoo(192.168.1.111) and the server is a pma430(192.168.1.108) that is a device under qtopia with dropbearssh

there are sshd_config and ssh_config

i added a line to the ssh_config:

```
Host 192.168.1.111

   ForwardX11 yes

   ForwardX11Trusted yes
```

but it still display the same messageLast edited by GNUtoo on Fri Sep 08, 2006 11:54 pm; edited 2 times in total

----------

## psycepa

whats the port of the server? ie. on which port the sshd accepts connections?

----------

## GNUtoo

 *psycepa wrote:*   

> whats the port of the server? ie. on which port the sshd accepts connections?

 

i don't know

how do i discover it?

----------

## psycepa

on a sshd server machine from root account:

```

cat /etc/ssh/sshd_config | grep Port

```

----------

## GNUtoo

Port 22

#GatewayPorts noLast edited by GNUtoo on Fri Sep 08, 2006 11:46 pm; edited 1 time in total

----------

## psycepa

in /etc/ssh/sshd_conifg:

(for example)

```

Port  3342

```

it is strongly recommended to set non-standard port in order to prevent your system from unauthorised access

then restart your server and to the client ssh call add

```

ssh blablabla -p 3342

```

(of course data should be appropriate to the real state of your configuration)

greetz

----------

oh and just a silly question

you have your ssh server up and running ?

ie. you did /etc/init.d/sshd ?

----------

## GNUtoo

 *psycepa wrote:*   

> in /etc/ssh/sshd_conifg:
> 
> (for example)
> 
> ```
> ...

 

that is very interesting and i should do this for all my ssh connection but:

```
# ssh 192.168.1.108 -p 3342

ssh: connect to host 192.168.1.108 port 3342: Connection refused

```

and yes i have sshd otherwise it would make another error such as:

```
# ssh 192.168.1.107 -p 3342

ssh: connect to host 192.168.1.107 port 3342: No route to host
```

----------

## GNUtoo

i should remove the (easy) from the title

----------

## psycepa

what give:

```

ps -aux | grep sshd

```

and

```

netstat -antp | grep

LISTEN
```

?

----------

## GNUtoo

#ps -aux | grep sshd

986 root 516 grep sshd

tcp 0.0.0.0:4992 0.0.0.0 LISTEN

tcp 0.0.0.0:4242 0.0.0.0 LISTEN

tcp 0.0.0.0:4243 0.0.0.0 LISTEN

----------

## psycepa

i have sth like this:

```

tcp 0 0 0.0.0.0:3342 0.0.0.0:* LISTEN 9336/sshd

```

 (put tabs instead of spaces)

and it works

what i see is that no ssh daemon is listening on any port

did you configure your ssh service on server correctly ?

have you used some guide or sth ?

greetz

----------

## GNUtoo

 *psycepa wrote:*   

> i have sth like this:
> 
> ```
> 
> tcp 0 0 0.0.0.0:3342 0.0.0.0:* LISTEN 9336/sshd
> ...

 

what is sth???

----------

## daemonflower

Seems you've forgotten to 

```
/etc/init.d/sshd start
```

If that works, you should do an 

```
rc-update add sshd default
```

to make the change permanent.

----------

## uber.grog

Actualy I think that this might be the 'problem'

 *new_to_non_X86 wrote:*   

> 
> 
> ```
> # ssh 192.168.1.108
> ```
> ...

 

Is the target device a Zaurus (or other embedded thingy)? If so, what does

```
ps ax | grep dropbear
```

produce? Have you set the root password? In a terminal:

```
$ su -

# passwd

(enter new password)
```

And then try to connect again.

```
$ ssh root@192.168.1.108
```

and let us know how it goes.

----------

## psycepa

 *new_to_non_X86 wrote:*   

> 
> 
> what is sth???

 

sth is an abbreviation of 'something'  :Wink: 

----------

