Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

No supported authentication methods available when trying to connect over SSH

Hi,

I am running Astaro Security Gateway v8.306. Enabled SSH, allowed network = any (I know it is not recommended, I just need to get it working with the basic settings first), password authentication only, set the loginuser password, checked the log: the SSH server is listening on port 22. 

On the client PC I can telnet to the port 22 on the ASG host (using the external IP host address). 

But when I try to log in using Putty or WinSCP I am getting the same error all the time:
Disconnected: No supported authentication methods available (server sent: publickey)

Also I do not see any login attempts in the SSH server log.

I've read a lot of threads and cannot find any solution. What am I doing wrong?


This thread was automatically locked due to age.
  • I don't really know why but without that DNAT rule (have just disabled it) I can access port 22 by external IP but I am getting the error described earlier:
    Disconnected: No supported authentication methods available (server sent: publickey)
  • Hi, if you have ANY in the Allowed Networks for SSH, you don't need a DNAT, and you can connect to the EXTERNAL IP address.

    Did you set Astaro to require SSH keys?

    Barry
  •  if you have ANY in the Allowed Networks for SSH, you don't need a DNAT, and you can connect to the EXTERNAL IP address.
    Barry

    That's what I've tried today and it didn't work, otherwise I would not complain
    I could access SSH by internal IP from the internal network (having connected over SSL VPN) and could not do the same thing using the external IP
    And that is the reason why I started playing with DNAT

    Sorry, what does an SSH key for Astaro mean?
  • Do you have it configured like Bruce mentioned?


    If you aren't interested in using the public key authentication, select the "Allow Password Authentication" option, and deselect the "public key" in the shell settings in Webadmin.  I suggest you review the manual and / or the context-sensitive online help regarding the pros / cons of each option.
  • You mean disable certificate authentication and leave only password. Yes, that is how it was configured originally. The error message "publickey" has nothing to do with the authentication method allowed in the SSH configuration as my login requests do not even reach the SSH service - I have checked the log. The packets are being dropped by the firewall. That is why I decided to set up a DNAT rule (with automatic filter rule) to see what happens. I inherited the gateway and didn't do the full review yet. I can see that there are only a few rules there, and one of the firewall rules is to explicitly deny any traffic which is not defined in the rules. It goes last in the list. Would it affect accessing port 22 which is configured in the SSH configuration? When one enables SSH does Astaro create some sort of automatic filter rules for the allowed networks?
  • What is your exact configuration?  If you have a piece of ISP CPE equipement there that runs SSH, you might be "hitting" that before the UTM... such a VDSL 2-Wire gateway, for example.
  • No, no equipment. I tried one thing right now.
    1) Disable the DNAT rule I configured and try to access the ASG by the external IP address and port 22
    Checked the firewall log and seeing this:

    /var/log/packetfilter.log:2012:12:04-17:59:11 ASG host name ulogd[5871]: id="2000" severity="info" sys="SecureNet" sub="packetfilter" name="Packet logged" action="log" fwrule="60021" initf="eth3.150" srcmac="x" dstmac="x" srcip="86.46.44.6" dstip="87.198.***.***" proto="6" length="52" tos="0x18" prec="0x00" ttl="115" srcport="56239" dstport="22" tcpflags="SYN"

    This is the only record in the file with my IP address. Looks like the packets were not dropped or anything, just logged?

    Checked the SSH server log - nothing

    2) Enable the DNAT rule and connect to the translated port 222
    Firewall log:

    /var/log/packetfilter.log:2012:12:04-18:24:33 ASG host name ulogd[5871]: id="2000" severity="info" sys="SecureNet" sub="packetfilter" name="Packet logged" action="log" fwrule="60021" initf="eth3.150" srcmac="x" dstmac="x" srcip="86.46.44.6" dstip="87.198.***.***" proto="6" length="52" tos="0x18" prec="0x00" ttl="115" srcport="56982" dstport="222" tcpflags="SYN"

    SSH server log:

    /var/log/sshd.log:2012:12:04-18:10:50 ASG hostname sshd[9851]: Accepted publickey for loginuser from 86.46.44.6 port 56503 ssh2

    Does it make any sense?
  • Please post the result of 'iptables -nvL | grep 22'.


    Here it is:

    ASG host name:/home/login # iptables -L INPUT -v -n | grep 22
    2204K  382M ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
  • Hi, Maya, and welcome to the User BB!

    When one enables SSH does Astaro create some sort of automatic filter rules for the allowed networks? 

    Yes, WebAdmin does a lot of stuff automatically.

    1) Disable the DNAT rule I configured and try to access the ASG by the external IP address and port 22
     Checked the firewall log and seeing this:
     
    /var/log/packetfilter.log:2012:12:04-17:59:11 ASG host name ulogd[5871]: id="2000" severity="info" sys="SecureNet" sub="packetfilter" name="Packet logged" action="log" fwrule="60021" initf="eth3.150" srcmac="x" dstmac="x" srcip="86.46.44.6" dstip="87.198.***.***" proto="6" length="52" tos="0x18" prec="0x00" ttl="115" srcport="56239" dstport="22" tcpflags="SYN"

    The bolded part means the NAT rule was still active.  My "Rule #2" is

    In general, a packet arriving at an interface is handled only by one of the following, in order:
    DNATs first, then VPNs and Proxies and, finally, manual Routes and Firewall rules.


    So that means that your DNAT is disrupting communication to the "External (Address)."  That your second DNAT worked is normal, but shouldn't be necessary.

    You'll be a lot happier if you grab puttygen.exe from http://www.astarosupport.org/Downloads/, and create RSA public and private keys.  Then, configure 'Shell Access' to 'allow root login: root access but only with ssh key' and add your new public key to 'Authorized keys for root.'  Finally, configure putty and WinSCP to login with public key authentication.  In putty, the 'Private key file for authentication' is found on 'Connection > SSH > Auth'.

    How's that working for you?

    Cheers - Bob
    PS I like your VPN approach, and usually combine it with limiting shell access to my home and offices and Astaro/Sophos Support IPs.