WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Login as root over telnet  (Read 5454 times)

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Login as root over telnet
« 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?

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Login as root over telnet
« Reply #1 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.

32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: Login as root over telnet
« Reply #2 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.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Login as root over telnet
« Reply #3 on: September 26, 2013, 12:42:13 PM »
Thanks Rich, unfortunately It's in the source code and we can't change it.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Login as root over telnet
« Reply #4 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

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Login as root over telnet
« Reply #5 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.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Login as root over telnet
« Reply #6 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?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: Login as root over telnet
« Reply #7 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.
 

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Login as root over telnet
« Reply #8 on: September 26, 2013, 01:16:38 PM »
Thanks Rich I thought of that.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Login as root over telnet
« Reply #9 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?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Login as root over telnet
« Reply #10 on: September 26, 2013, 01:31:23 PM »
See /etc/inittab
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Login as root over telnet
« Reply #11 on: September 26, 2013, 01:37:42 PM »
I changed directly it in /sbin/autologon. Was this wrong?