You are not logged in.

#1 2012-06-10 17:55:32

ijiboom
Member
Registered: 2012-05-19
Posts: 21

Creating an SSH private server

Hello. Having nothing to do today, I decided to set up a server on my home computer (arch-powered, of course). I realised that openssh-server does not exist in the official repositories or in the AUR. I looked at the wiki article on openssh, but it does not tell me how to create one, just how to join one, which is not what I'm trying to do... Can anyone help?

Last edited by ijiboom (2012-06-12 14:53:38)


"Flying is learning how to throw yourself at the ground and miss." Douglas Adams, Life, the universe and everything

Offline

#2 2012-06-10 17:59:45

defears
Member
Registered: 2010-07-26
Posts: 218

Re: Creating an SSH private server

Read the openssh wiki page and look for anything related to the daemon. That is the server. Openssh does both.

Offline

#3 2012-06-10 18:21:21

jordi
Member
Registered: 2006-12-16
Posts: 103
Website

Re: Creating an SSH private server

As defears pointed out, sshd is part of openssh. There is no separate package.

All you have to do is to tweak the `/etc/ssh/sshd_config` (not even necessary to just get started).
And start the daemon using rc.d start sshd

For more info see

    man sshd
    man sshd_config

Offline

#4 2012-06-12 14:54:59

ijiboom
Member
Registered: 2012-05-19
Posts: 21

Re: Creating an SSH private server

Yeah, you were right defears... Now the problem is, I've created the server and am running the daemon on startup. I'm trying to connect to it from my Android phone with this app called ConnectBot, and it tells me the "host has disconnected"...

Last edited by ijiboom (2012-06-12 14:56:11)


"Flying is learning how to throw yourself at the ground and miss." Douglas Adams, Life, the universe and everything

Offline

#5 2012-06-12 15:38:58

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Creating an SSH private server

Might be worth going through the openssh wiki article.

Aside from that, check if you can ssh locally (aka run "ssh -v localhost" from your archbox). If that works, your ssh daemon is functioning correctly; if not, read the wiki article because something's most likely wrong with your setup.


Burninate!

Offline

#6 2012-06-12 22:07:54

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,388

Re: Creating an SSH private server

Try to ssh into your home computer from your home computer and see if it connects.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#7 2012-06-12 23:48:09

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,227
Website

Offline

#8 2012-06-13 20:13:10

ijiboom
Member
Registered: 2012-05-19
Posts: 21

Re: Creating an SSH private server

tu fukawi, I have read that part many times already, it didn't help. As for Gcool, I've tried that already, it says the connection was refused. I've reinstalled openssh many times already, nothing seems to work.
Thanks anyway


"Flying is learning how to throw yourself at the ground and miss." Douglas Adams, Life, the universe and everything

Offline

#9 2012-06-13 20:37:01

defears
Member
Registered: 2010-07-26
Posts: 218

Re: Creating an SSH private server

Is your phone using wifi or 3g/4g? Are you trying with hostnames or ip addresses?

Offline

#10 2012-06-13 20:40:53

Zancarius
Member
From: NM, USA
Registered: 2012-05-06
Posts: 207

Re: Creating an SSH private server

Are you absolutely sure that sshd is running? What's the output of:

netstat -an | grep 22

Also, paste the output of

ssh -v localhost

as both Gcool and nomorewindows have suggested. Further, the output of:

ps aux | grep ssh

might be useful as well. You may want to look at /var/log/auth.log.

It's difficult to offer any suggestions without seeing a bit more about your particular circumstance, so be sure to copy and paste the appropriate lines (preferably in code tags).


He who has no .plan has small finger.
~Confucius on UNIX.

Offline

#11 2012-06-13 20:42:01

b4data
Member
Registered: 2010-12-14
Posts: 141

Re: Creating an SSH private server

Make sure you are using the correct IP address (ie your public IP address not your internal one), and make sure that you have the relevant ports open on your router/firewall.

Offline

#12 2012-06-13 21:09:17

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Creating an SSH private server

b4data wrote:

Make sure you are using the correct IP address (ie your public IP address not your internal one), and make sure that you have the relevant ports open on your router/firewall.

This is pretty irrelevant if connecting locally isn't even functioning.


Burninate!

Offline

#13 2012-06-13 21:15:03

b4data
Member
Registered: 2010-12-14
Posts: 141

Re: Creating an SSH private server

Gcool wrote:
b4data wrote:

Make sure you are using the correct IP address (ie your public IP address not your internal one), and make sure that you have the relevant ports open on your router/firewall.

This is pretty irrelevant if connecting locally isn't even functioning.

My bad, I missed the part where OP confirmed that, sorry.

Offline

#14 2012-06-16 12:27:18

ijiboom
Member
Registered: 2012-05-19
Posts: 21

Re: Creating an SSH private server

Allright so: 

 netstat -an | grep 22 

output :

 tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 192.168.1.35:57269      173.194.70.125:5222     ESTABLISHED
tcp        0      0 192.168.1.35:58220      173.194.35.47:443       ESTABLISHED
tcp        1      1 192.168.1.35:48787      80.247.227.201:80       LAST_ACK   
tcp6       0      0 :::22                   :::*                    LISTEN     
unix  3      [ ]         STREAM     CONNECTED     22354    @/tmp/.X11-unix/X0
unix  3      [ ]         STREAM     CONNECTED     12218    
unix  3      [ ]         STREAM     CONNECTED     12217    
unix  3      [ ]         STREAM     CONNECTED     9622     
unix  3      [ ]         SEQPACKET  CONNECTED     13522    
unix  3      [ ]         STREAM     CONNECTED     11522    @/tmp/dbus-5HDDwBxI78
unix  3      [ ]         STREAM     CONNECTED     13229    
unix  2      [ ]         DGRAM                    13222    
unix  2      [ ]         STREAM                   13022    

"Flying is learning how to throw yourself at the ground and miss." Douglas Adams, Life, the universe and everything

Offline

#15 2012-06-16 12:28:56

ijiboom
Member
Registered: 2012-05-19
Posts: 21

Re: Creating an SSH private server

Then,

 ssh -v localhost 

output:

OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/iraj/.ssh/id_rsa type -1
debug1: identity file /home/iraj/.ssh/id_rsa-cert type -1
debug1: identity file /home/iraj/.ssh/id_dsa type -1
debug1: identity file /home/iraj/.ssh/id_dsa-cert type -1
debug1: identity file /home/iraj/.ssh/id_ecdsa type -1
debug1: identity file /home/iraj/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0
debug1: match: OpenSSH_6.0 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA eb:2e:98:1a:cf:19:45:49:7b:30:40:7a:70:9e:45:50
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is eb:2e:98:1a:cf:19:45:49:7b:30:40:7a:70:9e:45:50.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/iraj/.ssh/id_rsa
debug1: Trying private key: /home/iraj/.ssh/id_dsa
debug1: Trying private key: /home/iraj/.ssh/id_ecdsa
debug1: Next authentication method: password
iraj@localhost's password: 
Connection closed by UNKNOWN

Last edited by ijiboom (2012-06-16 12:30:31)


"Flying is learning how to throw yourself at the ground and miss." Douglas Adams, Life, the universe and everything

Offline

#16 2012-06-16 12:32:05

ijiboom
Member
Registered: 2012-05-19
Posts: 21

Re: Creating an SSH private server

finally,

 ps aux | grep ssh 

output:

root       441  0.0  0.0  41984  1284 ?        Ss   16:20   0:00 /usr/sbin/sshd
iraj      1775  0.0  0.0   8656  1052 pts/0    S+   16:30   0:00 grep ssh

"Flying is learning how to throw yourself at the ground and miss." Douglas Adams, Life, the universe and everything

Offline

#17 2012-06-16 12:33:51

ijiboom
Member
Registered: 2012-05-19
Posts: 21

Re: Creating an SSH private server

As for how I'm connecting from my phone, I've tried my local IP address, my public one, from 3G, wifi, everything. It always gives the same output...


"Flying is learning how to throw yourself at the ground and miss." Douglas Adams, Life, the universe and everything

Offline

#18 2012-06-16 12:40:10

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,446

Re: Creating an SSH private server

When I see your last output I wonder what the result of that localhost connection attempt was and which part of your problem persists.

edit: We crossposted; I was referring to the ssh -v localhost output. Given your last post I assume the localhost connection worked then, but you still cannot connect from remote. Keep in mind the "host has disconnected" can also mean your router has closed the connection, i.e. not routed it to your localhost. Or do you see a connection attempt on the server?

Last edited by Strike0 (2012-06-16 12:46:31)

Offline

#19 2012-06-16 14:39:59

Awebb
Member
Registered: 2010-05-06
Posts: 6,517

Re: Creating an SSH private server

Get "Fing" for your phone (it's in the play store) and scan the network for your computer, then scan the computer for open ports. If you can't see the computer, maybe the router blocks inter-device communication.

Offline

#20 2012-06-16 18:16:40

Zancarius
Member
From: NM, USA
Registered: 2012-05-06
Posts: 207

Re: Creating an SSH private server

Also, post the output of your /var/log/auth.log file or at least the relevant lines that appear when you attempt to connect. The initial exchange looks good, but why it's dying after that is a mystery.

Have you run a pacman -Syu recently?


He who has no .plan has small finger.
~Confucius on UNIX.

Offline

Board footer

Powered by FluxBB