You are not logged in.

#1 2010-02-24 21:36:13

Redostrike
Member
Registered: 2010-02-07
Posts: 37

[Solved] SSH not working (ISP blocks my port 22)

OK full story:

I want to be able to connect to my home arch linux box from school. The setup there are winxp machines whit putty on my usb or the pc itself. I know that my school is not blocking any ports as my friend can connect to his linux box at home. (also ssh)

These are things i did and can think of i need to to do get ssh working:
Before everything else i started to configure my Linsys router.
My ISP gives me an Dynamic IP so i need to use the dyndns.org service. I made an account and configured my linsys router DDNS tab to work with the account. I got into the port forward tab an putted in ssh port forwarding (on port 22 TCP for my ip 192.168.1.102 => did ifconfig to be sure). Port forwarding for port 9091 is also on for my transmission webgui i'm saying this here because this works when i'm at school.


1. Installed openssh

# pacman -S openssh

All installed fine.


2. I've put the sshd into the daemon part of my rc.conf file.

DAEMONS=(syslog-ng network netfs crond @alsa @g15daemon @samba @sshd dbus hal)


3. Hosts.allow file =

#
# /etc/hosts.allow
#
SSHD: ALL
# End of file

4. Hosts.deny =

#
# /etc/hosts.deny
#

ALL: ALL: DENY

# End of file

5. sshd_config file =

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#AddressFamily any
ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

LoginGraceTime 120
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile    .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing, 
# and session processing. If this is enabled, PAM authentication will 
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none

# no default banner path
Banner /etc/issue

# override default of no subsystems
Subsystem    sftp    /usr/lib/ssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#    X11Forwarding no
#    AllowTcpForwarding no
#    ForceCommand cvs server

6. ssh_config file=

#    $OpenBSD: ssh_config,v 1.25 2009/02/17 01:28:32 djm Exp $

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

Host *
#   ForwardAgent no
#   ForwardX11 no
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
HashKnownHosts yes
StrictHostKeyChecking ask

7. Im sure SSH is running i even did => /etc/rc.d/sshd restart

8. I have never installed any firewall on my arch box (that i know off). I can connect to it using my other linux laptop
ssh -p 22 192.168.1.102 => works
ssh -p 22 xxxxxx.dyndns.org => works (xxx replaced by my dyndns.org domain)
ssh -p 22 9x.xxx.xxx.xx5 => works (xxx is my normal WAN ip offcourse)

Keep in mind that transsmission port forwarding is working fine. I can connect from everywhere to my webgui wich is on port 9091. Anyone can help me get whats wrong?

Last edited by Redostrike (2010-02-25 17:06:14)

Offline

#2 2010-02-24 21:44:37

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: [Solved] SSH not working (ISP blocks my port 22)

I don't know what the problem is but this is a really bad idea:

PermitRootLogin yes

All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#3 2010-02-24 21:52:34

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: [Solved] SSH not working (ISP blocks my port 22)

The standard port in ssh is 22, you can avoid write the flag -p 22.

Offline

#4 2010-02-24 21:54:27

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [Solved] SSH not working (ISP blocks my port 22)

thank for those tips i will keep them in mind. I changed the rootpermission to no.

Last edited by Redostrike (2010-02-24 21:54:48)

Offline

#5 2010-02-24 22:29:13

Ultraman
Member
Registered: 2009-12-24
Posts: 242

Re: [Solved] SSH not working (ISP blocks my port 22)

Wild guess but:

#
# /etc/hosts.allow
#
SSHD: ALL
# End of file

I don't know if this is case-sensitive, but if it is: it should be "sshd".
If it doesn't work, doesnt hurt to try.

Offline

#6 2010-02-25 17:05:22

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [Solved] SSH not working (ISP blocks my port 22)

Thanks for all the tips. I found out whats wrong.

My ISP blocks port 22 for them selves so i needed to take another port wich i have done and it all works fine now.

Offline

Board footer

Powered by FluxBB