Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: mbertrand on September 26, 2013, 11:51:21 AM

Title: Login as root over telnet
Post by: mbertrand on September 26, 2013, 11:51:21 AM
Hi know this is not secure but it need to work for someone.
My Tiny Core auto logs on as TC and starts x and everything works.
I have telnet running. We have a client that has a program and that program needs to reboot the TC computer.
He does this(in his source code that we can't change) by issuing the command 'reboot'. I gave him the root password and added
a couple of pseudo-terminals in the 'security' file to allow root login via telnet. To test it I connected via telnet which now accepts the root password and seems to login with no errors but I get the tc home folder and tc prompt. I'm not logged in as root. Then I read about the file in /etc/sysconfig/superuser. I thought that would allow login in as root which it does but also auto logs me in as root and no longer as tc?.

So is it possible to really log on as root and be root via telnet? If so, How?
Title: Re: Login as root over telnet
Post by: Lee on September 26, 2013, 12:18:41 PM
It is logging in as root but root's .profile causes it to immediately re-login as user tc.

Title: Re: Login as root over telnet
Post by: Rich on September 26, 2013, 12:20:55 PM
Hi mbertrand
Maybe you could just connect as user tc. Once connected, issue:
Code: [Select]
sudo suto become root.
Title: Re: Login as root over telnet
Post by: mbertrand on September 26, 2013, 12:42:13 PM
Thanks Rich, unfortunately It's in the source code and we can't change it.
Title: Re: Login as root over telnet
Post by: mbertrand on September 26, 2013, 12:42:55 PM
It is logging in as root but root's .profile causes it to immediately re-login as user tc.
Wow I would have never thought about that. I take a closer look. Thanks
Title: Re: Login as root over telnet
Post by: mbertrand on September 26, 2013, 12:51:35 PM
What does the .profile need to contain. Login will be done via telnet just to execure 'reboot' command and thats all.
No running x.
Title: Re: Login as root over telnet
Post by: mbertrand on September 26, 2013, 01:07:32 PM
I'm confused now I thought that auto logon was using user 'tc' but It's root login back in to tc?
Can I change autologon to logon as tc?
Title: Re: Login as root over telnet
Post by: Rich on September 26, 2013, 01:11:36 PM
Hi mbertrand
If the only reason you need root privileges is to reboot, change the permissions of the  reboot  command via bootlocal.sh.
 
Title: Re: Login as root over telnet
Post by: mbertrand on September 26, 2013, 01:16:38 PM
Thanks Rich I thought of that.
Title: Re: Login as root over telnet
Post by: mbertrand on September 26, 2013, 01:19:51 PM
Ok, I can now autologon as TC instead of root. I'm just playing around now but just out of curiosity why does TC by default autologon as root?
Title: Re: Login as root over telnet
Post by: tinypoodle on September 26, 2013, 01:31:23 PM
See /etc/inittab
Title: Re: Login as root over telnet
Post by: mbertrand on September 26, 2013, 01:37:42 PM
I changed directly it in /sbin/autologon. Was this wrong?