Question: Automatic launching of a CLI menu upon login (OpenBSD)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Question: Automatic launching of a CLI menu upon login (OpenBSD)
# 1  
Old 04-15-2011
Java Question: Automatic launching of a CLI menu upon login (OpenBSD)

Hi all,

I am OpenBSD newbie and currently need to manage some OpenBSD firewalls running pf. The OpenBSD version is 4.8

As the other sys admins are not so familiar with OpenBSD, so I have an idea across in my mind on how to minimize the root account usage and other unnecessary access and make the configuration/change of OpenBSD firewalls easier.

Let say if the IT Admin would like to manage the firewall from either console or ssh and they don't need to su in to do some config:

OpenBSD/i386

login: user1
password: password1


after they inputted the password and click enter, there will be another menu coming out on the screen instead of normal shell prompt ($)

>>>Welcome to the OpenBSD, please choose the option to configure:
1>Configure/Change IP address and subnet mask
2>View ifconfig
3>Configure/Change default route
4>Add/Remove static route
5>View routing table
6>Add/Change Name Server IP address
7>Add/Modify pf rule
8>Check pfstatus
9>Backup OpenBSD pf config
10>Quit

I really have no idea how to do that and the users are not allowed to access ($) or (#) at all to minimize human error(eg: accidentally delete config file etc) My intention is only giving them the necessary access to do the daily job.

Have you guys ever done the task like what I would like to do?
Can you give me the direction and hints on how to do that?

Regards,
Stefan
# 2  
Old 04-15-2011
First thing is to make yourself a test account, and change the login shell to run your script.
# 3  
Old 04-15-2011
Hi, stefan:

You'll have to setup sudo to allow the user your script runs as to use privileged pfctl features (same for other commands to alter the system's routing table, network interfaces, dns configuration, etc), unless you intend to run a suid shell script (the mere mention of it ... *gasp*). Smilie

Regards and welcome to the forum,
Alister
# 4  
Old 04-15-2011
I think setuid shell script is almost impossible, as the dynamic lib locations are not compiled into the shells!
# 5  
Old 04-15-2011
Quote:
Originally Posted by DGPickett
I think setuid shell script is almost impossible, as the dynamic lib locations are not compiled into the shells!
That suid sh script remark was intended as a joke, particularly given the platform in question. You're correct regarding the near impossiblity, but I believe you're reason is mistaken. Most modern UNIX platforms simply do not honor the suid bit for interpreted files.

I'm not certain what your dynamic library location remark means, unless you are referring to the fact that the loader ignores LD_LIBRARY_PATH and LD_PRELOAD for suid binaries. If so, that's an unrelated security issue.

Regards,
Alister
# 6  
Old 04-18-2011
No, that was it, when a ksh script is started without LD_LIBRARY_PATH, it dies, and the same for any other common interpreter. I guess if you did a static link or compiled in a path with -R or whatever, then it might work. You seem to think there is special code in exec() to not allow both interpreter #! files and setuid, but I think the library path was sufficient is stopping the foolish.
# 7  
Old 04-18-2011
Quote:
Originally Posted by DGPickett
No, that was it, when a ksh script is started without LD_LIBRARY_PATH, it dies, and the same for any other common interpreter.
What value does it demand for LD_LIBRARY_PATH, and why?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Scheduling automatic Internet explorer login

Hi , I am using windows XP and IE8 I have my credentials stored for a website in internet explorer. I want to implement below scenario. I have entered both username/password for a website and left IE explorer open and locked my computer I want the computer to login in that website... (1 Reply)
Discussion started by: Jcpratap
1 Replies

2. Solaris

Automatic Login to Desktop

On Solaris 11 is it possible to bypass the userid/password requirement to automatically login to the desktop ? I'm the sole user and it is really not necessary to secure the system. I have searched this forum and have not found a relevant post. (2 Replies)
Discussion started by: stansaraczewski
2 Replies

3. UNIX for Dummies Questions & Answers

Automatic login at startup

Hi, how can I set my linux server that it logs in the main user at startup? I would like to be able to make a restart remotely and be able to connect to the server again afterwards. The problem is that the server waits for a login and than connects to the network. So at the beginning at... (5 Replies)
Discussion started by: borobudur
5 Replies

4. Slackware

Automatic login without X

I know how to set up KDM or GDM to do automatic login, but is there a way to do it without GDM or KDM or X at all so when I start the machine I am immediately taken to a waiting command prompt? Thanks (5 Replies)
Discussion started by: raidzero
5 Replies

5. UNIX for Dummies Questions & Answers

Automatic login

I need a script that will let me connect to my hpux server with just a click of the icon without type my username and password. (5 Replies)
Discussion started by: tree740
5 Replies

6. Solaris

Automatic login

Hi, Boss I have a question.... BackGround: i have a shell name xxxLineInput.x the useage is: xxxLineInput.x -Txxx -Uxxx -Pxxx when i use the command line..can run normal. Target: i want to set automatic login, the mean is when i login the as the specifical... (0 Replies)
Discussion started by: surainbow
0 Replies

7. UNIX for Advanced & Expert Users

Automatic login

Hello all, I need a script that can run an sftp session into a remote server, and retreive a file. Does anyone know how to pass in the user/password details in a script? I seem to have forgotten (5 Replies)
Discussion started by: Khoomfire
5 Replies

8. Shell Programming and Scripting

Automatic login script

Hi, I'm a beginner in unix.As a part of my script i need to remote logon using ssh. my script run as being asked for password and logons only after the user enters the password correctly. But my script stops executing after that as I login to a different server(different shell if i'm right).... (3 Replies)
Discussion started by: dayanand
3 Replies

9. UNIX for Advanced & Expert Users

Automatic time out of user login

I have asked by our security team to implement an automatic time out for user logins after a specified time interval. I have never heard of this feature in Unix before. Does anyone know of a way to accomplish this for HP-UX 11i? (2 Replies)
Discussion started by: keelba
2 Replies

10. BSD

openbsd : cannot login

hi OK. I don't know exactly what I did to system! The system is OpenBSD 3.5. It is 200MMX, 16MB ram 1.2 + 2.4 GB HDD. The system was running well. But a few days ago I try to unpack a big tar.gz file and the system uses most the cpu and ram for this. While the system unpacking the file I try to... (4 Replies)
Discussion started by: fnoyan
4 Replies
Login or Register to Ask a Question