8 Replies Latest reply on Dec 2, 2015 5:17 AM by BenKissBox

    Password for Telnet (with Yoctos on SD card)

    BenKissBox

      Hello all,

       

      I am facing a strange problem with my Galileo.

      When I run it without the SD card, I can connect over Telnet (using a sketch launching "telnetd") being root and without password.

       

      When I use the SD card with Yoctos on it, I can not connect via Telnet, because the shell keeps asking me the password for root. I tried everything I had in mind (root, admin, password, etc....)

       

      Here is what I get on the telnet console

       

      Poky 9.0.2 (Yocto Project 1.4 Reference Distro) 1.4.2 clanton

       

       

      clanton login: root

      Password:

      Login incorrect

       

      clanton login: root

      Password:

      Login incorrect

       

      clanton login: root

      Password:

      Login incorrect

       

      clanton login: root

      Password:

      Login incorrect

       

       

      so the question is very stupid and simple : what is the password for Telnet ?

       

      (Yes, I know that I can use SSH... and it works with SSH without any password. But I hate to find this kind of things and no knowing why it does not work )

       

      Thanks

       

      Benoit

        • 1. Re: Password for Telnet (with Yoctos on SD card)
          DiegoV_Intel

          Hello BenKissBox,

           

          I've just connected to Galileo's terminal via Telnet with no issues. Could you please let me know how you connected via Telnet?

           

          Please check below the steps I did to connect via Telnet:

           

          • Power up the Galileo board. I used a Galileo Gen2 booting from the SD card with the following Yocto image: http://downloadmirror.intel.com/24355/eng/SDCard.1.0.4.tar.bz2
          • Open a console session using PuTTY. I connected using the FTDI cable.
          • Once the booting process is done, I connected the Ethernet cable between the Galileo board and my laptop. The following outcome should be displayed in the console session:

          telnetA.JPG

           

          telnetd -l /bin/sh
          ifconfig eth0 169.254.1.1 netmask 255.255.0.0 up
          
          
          
          
          
          
          

           

          • At this point the eth0 interface should be configured. You can run the command ifconfig eth0 to make sure the IP address and the netmask were set properly.
          • Open another PuTTY session and connect via Telnet. Use the IP address that you just entered to configure the eth0 interface. You should get access now. Check the screenshot below. I didn't have to enter a login nor a password.

          telnetB.JPG

           

          Regards,

          Diego.

          • 2. Re: Password for Telnet (with Yoctos on SD card)
            BenKissBox

            Hello Diego,

             

            thank you for your investigation and your answer. To answer your different questions:

            - I made the test on a Gen 1, not a Gen 2 (maybe it explains the difference, but I am convinced it's not the case)

            - I just run a basic sketch with the following commands on the setup() function

             

              system("ifconfig eth0 inet 192.168.0.150 netmask 255.255.255.0 up");

              system ("telnetd");


            in order to have a static IP address and the telnet daemon running

             

            - I connect using the Mac OS Telnet client program. The problem occurs when I enter the command "open 192.168.0.50", I get the screenshot I reported just over there (asking me for a password)

             

            Benoit

            • 3. Re: Password for Telnet (with Yoctos on SD card)
              FGT

              Hi Benoit,

               

              I think the problem is in the commands you are using:

               

                system("ifconfig eth0 inet 192.168.0.150 netmask 255.255.255.0 up");

                system ("telnetd");

               

              More specifically, I'm using

              system ("telnetd -l /bin/sh");

               

              I'm also using a little bit different command to "start" eth0, but it should not be a problem because you reported the ssh is working.


              HTH,


              Fernando.



              • 4. Re: Password for Telnet (with Yoctos on SD card)
                DiegoV_Intel

                Hello BenKissBox,

                 

                You mentioned that the issue only happens when booting the Galileo from the SD card Yocto image. What image are you using? I tested the Telnet connection using the following image: http://downloadmirror.intel.com/24355/eng/SDCard.1.0.4.tar.bz2. Please try with that image to see if you get different results.

                 

                And as FGT suggested, use the following lines in your Arduino sketch:

                system("telnetd -l /bin/sh"); 
                system("ifconfig eth0 169.254.1.1 netmask 255.255.0.0 up");
                

                 

                And add the following lines to check the eth0 interface settings in the Serial Monitor:

                delay(3000);
                system("ifconfig eth0 > /dev/ttyGS0");
                

                 

                Regards,

                Diego.

                • 5. Re: Password for Telnet (with Yoctos on SD card)
                  joe-iot

                  I don't have the SD Card image installed right now. But in most linux OS's there is a default setting to deny telnet access for root. This is because, as you know telnet traffic is transmitted in clear text . Since the root user is obviously a privileged account you would not use telnet for that user.

                   

                  Look for a file in /etc called login, see if root is denied.

                   

                  As an example on the iot dev kit the file is /etc/login.access

                   

                  Cheers,

                  -Joe

                  • 6. Re: Password for Telnet (with Yoctos on SD card)
                    FGT

                    @

                    joe-iot wrote:

                     

                    I don't have the SD Card image installed right now. But in most linux OS's there is a default setting to deny telnet access for root. This is because, as you know telnet traffic is transmitted in clear text . Since the root user is obviously a privileged account you would not use telnet for that user.

                     

                    Look for a file in /etc called login, see if root is denied.

                     

                    As an example on the iot dev kit the file is /etc/login.access

                     

                    Cheers,

                    -Joe

                    Hmmm... then we are using different yocto images... at the very least: I'm able to use telnet as described above (and which Diego has verified too).

                     

                    Take into account that, as pointed out in another thread (Reset button bug with sd card image):

                    There is a yocto intended to be used with XDK: "You can boot your Intel® Galileo board using a micro SD card that contains the latest Intel® IoT Developer Kit version of the Yocto* built, Linux image." (Making a bootable micro SD Card with Windows* | Intel® Developer Zone) and there is an image not related to XDK, just intemded to be used for (Arduino) sketch persistency (maybe among other tasks I do not know about), so it is not necessary to have anything related to SDK-IoT Dev. Kit, etc., and which is the one I'm using and Diego suggested and included the link to.

                     

                    About security... well... that's "beyond the scope" any analysis I could make right now...

                     

                    HTH,

                     

                    Fernando.

                    • 7. Re: Password for Telnet (with Yoctos on SD card)
                      joe-iot

                      Well it was just a guess   I am not using the SDCard.1.0.4.tar.gz right now. I am using the file  iot-devkit-latest-mmcblkp0.direct which has those config options.

                       

                      Cheers,

                      -Joe

                      • 8. Re: Password for Telnet (with Yoctos on SD card)
                        BenKissBox

                        Hello all,

                         

                        thank you to Diego and FGT, your proposal were the right one.

                        If I use system("telnet -l /bin/sh"), I am able to log from a Telnet client without any problem (the Galileo does not ask anymore for login and password)

                         

                        Benoit