LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2015, 08:26 AM   #1
wowy
Member
 
Registered: Mar 2015
Location: France
Distribution: Ubuntu 14.04
Posts: 61

Rep: Reputation: Disabled
How to configure telnetd on an Embedded linux ?


I am currently working on a sbc6000x board with linux 2.6.24 on it and would like to use the telnetd command from busybox (v1.4.2).
I can run the Telnet daemon on the board and try to connect to it from another computer but each time the connection close.

In the terminal of the computer i have : (i changed the ip with Ipoftheboard here)

Trying Ipoftheboard
Connected to Ipoftheboard
Escape character is '^]'.
Connection closed by foreign host.

I already tried to use the hosts.allow file with :
ALL : Ipofthecomputer

And i checked in /etc/initd.conf and Telnet is enabled.
I read that maybe the connection is closing because i don't have a user/password configured for the Telnet connection but i can't find where to configure them.

I must use Telnet, i can't use another solution like ssh.
 
Old 03-10-2015, 09:18 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Is it possible the login doesn't have a valid shell? This is the symptom if the shell is /bin/false for instance.

If the message is "connection refused" might check the firewall.
 
Old 03-10-2015, 09:40 AM   #3
wowy
Member
 
Registered: Mar 2015
Location: France
Distribution: Ubuntu 14.04
Posts: 61

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
Is it possible the login doesn't have a valid shell? This is the symptom if the shell is /bin/false for instance.

If the message is "connection refused" might check the firewall.
The system don't ask for a login/password when booting and don't ask one too when trying to connect with Telnet. When searching in /bin/ i have a "false" file.
How could i fix it if the issue is coming from this ?

I never had "connection refused", only "Connection closed by foreign host.".
 
Old 03-10-2015, 10:00 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by wowy View Post
The system don't ask for a login/password when booting and don't ask one too when trying to connect with Telnet. When searching in /bin/ i have a "false" file.
How could i fix it if the issue is coming from this ?

I never had "connection refused", only "Connection closed by foreign host.".
You have to look in the /etc/passwd file. If the login being used has /bin/false for the users shell then you have to change it to a valid shell. (I would suggest using busybox, but I'm not sure that is what you really want, but if this is for debugging, then I would think it would be).

Last edited by jpollard; 03-10-2015 at 10:01 AM.
 
1 members found this post helpful.
Old 03-10-2015, 10:10 AM   #5
wowy
Member
 
Registered: Mar 2015
Location: France
Distribution: Ubuntu 14.04
Posts: 61

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
You have to look in the /etc/passwd file. If the login being used has /bin/false for the users shell then you have to change it to a valid shell. (I would suggest using busybox, but I'm not sure that is what you really want, but if this is for debugging, then I would think it would be).
It seems that none of them is using /bin/false :

Code:
root::0:0:root:/:/bin/sh:
bin:*:1:1:bin:/bin::
daemon:*:2:2:daemon:/sbin::
nobody:*:99:99:Nobody:/::
But as i read this i can notice that there is a root but no user.

What i want is to be able to have the hand on the board from another computer.
 
Old 03-10-2015, 10:21 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
I see that root doesn't have a password either. bin/daemon/nobody are disabled (the *).

If the system is using shadow passwords (it would be indicated by an X in the password field), then not even root can login over the net.

I'm not sure about the configuration of busybox (and its embedded telnetd) but it is likely using the login utility to login, and that usually disables root from loggging in (or anyone else for that matter) without a password. If that is the case here, there is no one that can login.
 
1 members found this post helpful.
Old 03-10-2015, 10:25 AM   #7
wowy
Member
 
Registered: Mar 2015
Location: France
Distribution: Ubuntu 14.04
Posts: 61

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
I see that root doesn't have a password either. bin/daemon/nobody are disabled (the *).

If the system is using shadow passwords (it would be indicated by an X in the password field), then not even root can login over the net.

I'm not sure about the configuration of busybox (and its embedded telnetd) but it is likely using the login utility to login, and that usually disables root from loggging in (or anyone else for that matter) without a password. If that is the case here, there is no one that can login.
Ok.
Is there a way for me to add a password to the root ? (by a command or by directly editing files)
I would think editing the passwd file but i prefer to ask before doing something and making my board a "brick".
 
Old 03-10-2015, 10:42 AM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
I would suggest adding a new account, and then set the password on that instead. That way the defaults are always available for recovery... You might be able to use a root alias (myroot for instance) with a password. How to get the password there though (there is a mkpasswd, but you might have to edit the /etc/passwd file to get it put in, or create the shadow file - as its use is a configuration option of busybox).

There is also this (though it is using a serial line for login):
https://forum.openwrt.org/viewtopic.php?id=16900
 
Old 03-10-2015, 11:14 AM   #9
wowy
Member
 
Registered: Mar 2015
Location: France
Distribution: Ubuntu 14.04
Posts: 61

Original Poster
Rep: Reputation: Disabled
Ok.
I will try to add a new user by editing the passwd file because it seems that this linux distro don't know sudo or useradd.
 
Old 03-10-2015, 11:42 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
The only things it knows about by default is what busybox provides. It is an embedded system after all, and there isn't usually that much space available for utilities.
 
Old 03-11-2015, 05:33 AM   #11
wowy
Member
 
Registered: Mar 2015
Location: France
Distribution: Ubuntu 14.04
Posts: 61

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
The only things it knows about by default is what busybox provides. It is an embedded system after all, and there isn't usually that much space available for utilities.
I tried to create a new user by editing the passwd file :

Code:
user:password:3:0:user:/:/bin/sh
But i don't seems to be able to login with it. After searching in bin and sbin i don't see any "login" file.
And i can't find any explanation on how to add this command or update the busybox on my Embedded system.
It is to note that busybox was already on the system, i did not install it and i can find information only about installation on a normal system (like my ubuntu computer with no problem) but not on Embedded.
 
Old 03-11-2015, 07:07 AM   #12
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
I think you will have to reprogram the flash and add the login utility , or use an SDRAM to boot from.

The boot code should be able to download the entire filesystem from ethernet, but it should be documented with what came with the board (from what I can find it should be called "SBC6000X Linux User Manual": http://www.jiggerjuice.info/electron.../SBC6000X.html).

BTW, there is a reference in that URL to why telnet doesn't work. Maybe that is why (the /dev/pts entries and mount for the pseudoterminal support are missing, and a fix for it).

Hope it helps.
 
Old 03-11-2015, 07:15 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,965

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
I am unfamiliar with this particular SBC but this might help

http://jiggerjuice.info/electronics/.../SBC6000X.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure Snort on Linux Embedded Board SangitaMohanty Linux - Networking 1 07-25-2012 03:23 PM
Xpert in 8-16 bit microcontroller embedded system now inclining toward embedded linux priyadarshan Linux - Embedded & Single-board computer 2 02-12-2009 05:28 AM
LXer: Embedded Linux as Dependable for Developers as RTOSes, says Embedded Market For LXer Syndicated Linux News 0 01-23-2008 12:40 PM


All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration