×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

There are a few ways:

1. update the user's profile, normaly it is in /home/user_name/.profile, add the program at the end of the file followed by 'exit' statement.
(Warning: You have to make sure turn off the signals, etc TERM, KILL, otherwise someone can
hacked it),
It is not a very safy way, but convenient.

2. change the /etc/passwd file, change the default shell to you program.
But this way you have to provide user/passwd verification by you self and deal with other issues, like make it a standalone process, response to the TTY lines,...

it is more safe than the first

3. hack the login program in Linux/Unix.
change the default login program, make it pass the control to you program after it finishs its work.
this is the most saftest way, and more difficult. Unless the security is the most important for you,
do not try this.
Report

Replies, comments and Discussions:

  • 工作学习 / 专业技术讨论 / when telnet unix server, you see a text-based menu, anybody knows What programming technology it is? thx.
    • FireBird BBS source code should be a good starting......
      • I don't need BBS, I'd like to restrict login user's operation with menus, is it possoible? that would be better if login script can do it, thx.
      • do you mean it is written in C language? thx
    • There are a few ways:
      1. update the user's profile, normaly it is in /home/user_name/.profile, add the program at the end of the file followed by 'exit' statement.
      (Warning: You have to make sure turn off the signals, etc TERM, KILL, otherwise someone can
      hacked it),
      It is not a very safy way, but convenient.

      2. change the /etc/passwd file, change the default shell to you program.
      But this way you have to provide user/passwd verification by you self and deal with other issues, like make it a standalone process, response to the TTY lines,...

      it is more safe than the first

      3. hack the login program in Linux/Unix.
      change the default login program, make it pass the control to you program after it finishs its work.
      this is the most saftest way, and more difficult. Unless the security is the most important for you,
      do not try this.
      • cool!!, I'd like to go with the easiest way. Is there anyway to prevent user terminating a script like pressing "ctrl + C" so that the use has to stay within the options script provided. THX!
    • 1. shell: echo, read; 2. c: cursers
      • Can you give an example? thx!