SliTaz SliTaz Forum

You are not logged in.

#1 2013-02-01 15:34:54

arodulfo
Member
Registered: 2012-11-03
Posts: 71

Managing consoles

Dear all,

I have been asked to secure the current project application against being killed or tampered with.

Of course, I can put a daemon to keep an eye on the system and, in case anybody kills the app, immediately restart it.

However, if there were no text console to use for wandering the system during the application execution, nobody would be able to "play" with it beforehand.

Is there any way for me to keep the consoles from appearing when pressing ctrl-alt-fx?

Anywhere to look for help?

EDIT: Of course, the application runs in ctrl-alt-f7 and I want to prevent anybody from using ctrl-alt-f1 to f6 to log into the system

Thanks a lot, guys.

Antonio

Offline

#2 2013-02-01 16:39:05

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: Managing consoles

# sed -i 's/^tty/#&/' /etc/inittab

# kill -1 1

Offline

#3 2013-02-01 16:39:24

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: Managing consoles

did you try this?

http://ubuntuforums.org/showthread.php?t=776098

chek /etc/X11/xorg.conf.d/* files

Offline

#4 2013-02-01 16:48:21

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: Managing consoles

Edit /etc/inittab as root and comment out:

[c]# /sbin/getty respawn shell invocations for selected ttys.
tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
tty5::respawn:/sbin/getty 38400 tty5
tty6::respawn:/sbin/getty 38400 tty6[/c]
Although disabling the virtual terminals might come back to bite you in the ass when you have to kill a non-responsive program that's stalling X with it.

Offline

#5 2013-02-01 16:57:40

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: Managing consoles

would not the inittab mod prevent login at boot too?

what if X does not start?

Offline

#6 2013-02-01 17:27:14

arodulfo
Member
Registered: 2012-11-03
Posts: 71

Re: Managing consoles

@Trixar_za: I fully agree, that's always possible.

I have been looking at [c]/etc/inittab[/c], thinking of using a daemon for temporarily commenting all those lines out. On detecting the proper scenario (i.e., presence of a given "legal" USB pendrive in any of the available USB ports), the daemon would uncomment [c]tty1[/c] line and would grant access to a potential user through that text console. Is that possible?

@ernia: Let's assume I can devise such a daemon. Your suggestion would comment all those lines in [c]/etc/inittab[/c] and... what exactly would do [c]kill -hup init[/c]? Wouldn't it be the equivalent to a hot reset? As far as I know, it would force [c]init[/c] to restart, wouldn't it?

Thanks a lot for being there.

Kind regards,

Antonio,

Offline

#7 2013-02-01 17:42:09

arodulfo
Member
Registered: 2012-11-03
Posts: 71

Re: Managing consoles

@ernia: As far as I know, X activities are conducted on [c]tty7[/c] only. If we limit this trick to consoles [c]tty1[/c] to [c]tty6[/c], there won't be any problem, isn't it?.

Did I properly understand [c]kill -1 1[/c]?

Thanks a lot.

Kind regards,

Antonio

Offline

#8 2013-02-01 17:48:50

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: Managing consoles

kill -1 1 asks the init process to re-read /etc/inittab.

Offline

#9 2013-02-01 19:01:16

arodulfo
Member
Registered: 2012-11-03
Posts: 71

Re: Managing consoles

@Trixar_za, @ernia: I have just tested the trick and it works. Er... somehow!

I decided to lock all the consoles, refresh [c]init[/c], unlock [c]tty2[/c], refresh [c]init[/c] and try:

There's no activity on [c]tty2[/c], and [c]tty1[/c] accepts text but doesn't react to it.

Now, I have to leave now and will be back on early Monday. Once back at my desktop, I will restart the system with a Live CD and will try again with a different setup. Let's comment it then.

Thanks a lot.

Kind regards,

Antonio,

Offline

#10 2013-02-01 19:09:59

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: Managing consoles

@arodulfo

it was Bellard to propose you kill -1 1 , i'm too noob to understand it :-)

Offline

#11 2013-02-05 18:27:15

arodulfo
Member
Registered: 2012-11-03
Posts: 71

Re: Managing consoles

@bellard: I have retyped everything and double-checked the trick, both through plain reboot and through live init refresh ([c]kill -1 1[/c]). I t works as smooth as anybody would expect.

It works both with tty1 and tty2 and I assume it would work with them all.

I made some typo most probably..

Now it's my time to code a way for including / combining this trick into / with my application...

Thank you so much to everybody!

Kind regards,

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]