How i can connect the board with ssh?

  • Hello f&s-team,


    every time i would connect the board with ssh i get the following message:


    [ssh: connect to host 192.168.0.12 port 22: Connection refused][/code]


    I also create a new user on the board.


    with best regards

  • Hello,


    I tried it with armStoneA9 but anyway if it will not work I will try with efus...
    Are you connecting from your board to your computer or vice versa?
    I tried to connect from my board to my host and I got the same message. When I'm connecting from my host to my board everything works fine.
    Command to connect from host to board: ssh root@<ipaddress of board>


    Kind Regards


    A. Zeiler
    F&S

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,


    maybe you can try to generate new keys on the board. Normally the ssh keys will be generated at first startup.
    The script in /etc/init.d/S50ssh checks for keys in /etc:
    -rw------- 1 root root 672 Mar 27 2015 ssh_host_dsa_key
    -rw-r--r-- 1 root root 590 Mar 27 2015 ssh_host_dsa_key.pub
    -rw------- 1 root root 227 Mar 27 2015 ssh_host_ecdsa_key
    -rw-r--r-- 1 root root 162 Mar 27 2015 ssh_host_ecdsa_key.pub
    -rw------- 1 root root 387 Mar 27 2015 ssh_host_ed25519_key
    -rw-r--r-- 1 root root 82 Mar 27 2015 ssh_host_ed25519_key.pub
    -rw------- 1 root root 965 Mar 27 2015 ssh_host_key
    -rw-r--r-- 1 root root 630 Mar 27 2015 ssh_host_key.pub
    -rw------- 1 root root 1675 Mar 27 2015 ssh_host_rsa_key
    -rw-r--r-- 1 root root 382 Mar 27 2015 ssh_host_rsa_key.pub


    Maybe they are expired or something else. Then you remove these files:" rm /etc/ssh_host_* "
    After the files are deleted you can create new ones with "sh /etc/init.d/S50ssh start".
    You should get something like this:


    Also it could be useful to remove your board from the known_hosts file on your host-PC.
    ssh-keygen -f "/home/<username>/.ssh/known_hosts" -R <board-ip>
    This is on Linux Mint. So maybe it is different on other distributions.


    Now you can try to connect again with ssh root@<board-ip>


    Then there could be this output:
    The authenticity of host '10.0.0.253 (10.0.0.253)' can't be established.
    ECDSA key fingerprint is 53:3a:b7:c8:5a:5c:9b:e3:81:8a:53:c2:ff:6e:8c:1e.
    Are you sure you want to continue connecting (yes/no)?


    Press 'yes' and you should get a connection to the board.


    Kind regards


    A. Zeiler
    F&S

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

    Edited once, last by fs-support_HK ().

  • Hello,


    at first: thanks for your answer! It works fin.
    But now, I have another problem. Everytime I connected to the board and I enter my password, I got the following message:


    ssh Till@192.168.0.12
    Till@192.168.0.12's password:
    WARNING: Your password has expired.
    You must change your password now and login again!
    passwd: must be suid to work properly
    Connection to 192.168.0.12 closed.


    I'm also changed the userpassword on the board, but it does'nt help.


    Thanks for your answer.

  • The password is always expired because the time of the board is not set correctly. There are several ways to avoid this warning and have a correct time.

    • Set the time with command date before trying to login with ssh.
    • Set the time once and apply the battery power when the board is switched off. Then the Real Time Clock will go on while power is off and the time is automatically set to the correct value at the next start.
    • Activate some kind of nntp-daemon when booting to fetch the current time from an online time server.

    Or you can go the other way round and define a password that never expires by editing /etc/shadow. However I'm not sure if ssh requires a correct date for security reasons. In this case this second method will not work and you actually have to set the correct time.


    Remark: If this is all just to have some remote way to enter commands, you may go with telnet instead of ssh. telnet does not require all this security stuff, but of course is also less secure then.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.