Sponsored Content
Full Discussion: Login page in html on unix
Top Forums Web Development Login page in html on unix Post 302314415 by pludi on Friday 8th of May 2009 08:44:13 AM
Old 05-08-2009
Take this simple script:
Code:
#!/bin/bash
echo -e "Content-Type: text/plain\n\n"
env
echo "-------------"
id

Put it in your servers /cgi-bin/ directory as minimal.sh, make it executable, and then call it from your browser as http://localhost/cgi-bin/minimal.sh?a=b&c=d&e=ü
Example output:
Code:
SERVER_SIGNATURE=<address>Apache/2.2.4 (Linux/SUSE) Server at localhost Port 80</address>

HTTP_KEEP_ALIVE=300
HTTP_USER_AGENT=Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.5) Gecko/2008121300 SUSE/3.0.5-2.3 Firefox/3.0.5
SERVER_PORT=80
HTTP_HOST=localhost
DOCUMENT_ROOT=/srv/www/htdocs
HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7
SCRIPT_FILENAME=/srv/www/cgi-bin/minimal.sh
REQUEST_URI=/cgi-bin/minimal.sh?a=b&c=d&e=%C3%BC
SCRIPT_NAME=/cgi-bin/minimal.sh
HTTP_CONNECTION=keep-alive
REMOTE_PORT=50421
PATH=/usr/sbin:/bin:/usr/bin:/sbin
PWD=/srv/www/cgi-bin
SERVER_ADMIN=[no address given]
HTTP_ACCEPT_LANGUAGE=de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
REMOTE_ADDR=127.0.0.1
SHLVL=1
SERVER_NAME=localhost
SERVER_SOFTWARE=Apache/2.2.4 (Linux/SUSE)
QUERY_STRING=a=b&c=d&e=%C3%BC
SERVER_ADDR=127.0.0.1
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
HTTP_CACHE_CONTROL=max-age=0
HTTP_ACCEPT_ENCODING=gzip,deflate
REQUEST_METHOD=GET
_=/usr/bin/env
-------------
uid=30(wwwrun) gid=8(www) groups=8(www)

Notice the part in blue? That are the parameters for the script. The part in red? The Unicode codepoint for ü, as it was sent by my browser. If you really want to code this in bash, there are no libraries or other helpers for that kind of stuff. And you're not even tracking sessions yet.

What you'd have to do is code the login logic, authentication, authorization, and since the users should be able to run scripts, some kind of security lest you want to lose data.
 

9 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Unix Manual (man-page) pages in HTML

LINK: Unix Manual (man page) pages in HTML http://www.rt.com/man/ : More then 100 Commands found on a Unix system mannual pages can be obtained/refered here. Good Link.. (1 Reply)
Discussion started by: killerserv
1 Replies

2. Shell Programming and Scripting

linking unix generated text file to html page

i am trying to link the text files that i generated from my shell script to an html page, to that i can view them using a browser, like internet explorer. i want to open the text files in html page when i enter a command to view the text file from the shell command. please could anyone help... (1 Reply)
Discussion started by: alexd
1 Replies

3. UNIX and Linux Applications

Html web page to Unix Connectivity

Hi All, I need a basic overview of connecting a HTML web page to Unix I will give a brief of my exact requirement. There will be a front end HTML page - a web page which will have certain buttons. Each button will have certain functionality. For eg: There is a button for Disk Usage. When the... (1 Reply)
Discussion started by: abhilashnair
1 Replies

4. Web Development

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both,... (2 Replies)
Discussion started by: WhotheWhat
2 Replies

5. Cybersecurity

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both, when... (1 Reply)
Discussion started by: WhotheWhat
1 Replies

6. Solaris

Accessing a HTML page

Hi All, In our unix server we have an apache web server running. I can access the default apache web page from my windows machine. Now, I want to create my own webpage. Therefore I created webpage at /export/home/myname/test.html file. Where do I need to place this file and what do I need... (0 Replies)
Discussion started by: pkm_oec
0 Replies

7. Shell Programming and Scripting

Execute unix command from an html page in windows

i have a problem situation, where i have a html file say click.html. i have a button "ls" in that html page. i run this html file in windows....Now say if i click that "ls" button it must connect to the unix server and execute ls and return the results back to html page in windows. can anyone tell... (8 Replies)
Discussion started by: niteesh_!7
8 Replies

8. AIX

How to Use a UNIX Shell Script to Create an HTML Web Page?

dear friends , in my work i have to monitor some system performance in hourly basis by runing some commands , for example (lpstat) to know that all the queue is ready how can i create webpage and connect it with the server (AIX operating system) and make this page refreshed every 10 second and... (12 Replies)
Discussion started by: rami abusweilei
12 Replies

9. Shell Programming and Scripting

How to generate HTML page from UNIX script out-put?

Hi All. This my first post to this forum, and i assuming it will be best out-of all. I am quite new to Unix scripting so please excuse me for any silly questions - I am trying to create on Unix script in which it telnet to my server, check the connectivity of the server and then it... (2 Replies)
Discussion started by: HHarsh
2 Replies
httpd_apcupsd_cgi_script_selinux(8)		      SELinux Policy httpd_apcupsd_cgi_script		       httpd_apcupsd_cgi_script_selinux(8)

NAME
httpd_apcupsd_cgi_script_selinux - Security Enhanced Linux Policy for the httpd_apcupsd_cgi_script processes DESCRIPTION
Security-Enhanced Linux secures the httpd_apcupsd_cgi_script processes via flexible mandatory access control. The httpd_apcupsd_cgi_script processes execute with the httpd_apcupsd_cgi_script_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier. For example: ps -eZ | grep httpd_apcupsd_cgi_script_t ENTRYPOINTS
The httpd_apcupsd_cgi_script_t SELinux type can be entered via the shell_exec_t, httpd_apcupsd_cgi_script_exec_t, httpd_apcupsd_cgi_script_exec_t file types. The default entrypoint paths for the httpd_apcupsd_cgi_script_t domain are the following: /bin/d?ash, /bin/zsh.*, /bin/ksh.*, /usr/bin/d?ash, /usr/bin/zsh.*, /usr/bin/ksh.*, /bin/esh, /bin/mksh, /bin/sash, /bin/tcsh, /bin/yash, /bin/bash, /bin/fish, /bin/bash2, /usr/bin/esh, /usr/bin/sash, /usr/bin/tcsh, /usr/bin/yash, /usr/bin/fish, /usr/bin/mksh, /usr/bin/bash, /sbin/nologin, /usr/sbin/sesh, /usr/bin/bash2, /usr/sbin/smrsh, /usr/bin/scponly, /usr/sbin/nologin, /usr/libexec/sesh, /usr/sbin/scponlyc, /usr/bin/git-shell, /usr/libexec/git-core/git-shell, /var/www/cgi-bin/apcgui(/.*)?, /var/www/apcupsd/multimon.cgi, /var/www/apcupsd/upsim- age.cgi, /var/www/apcupsd/upsstats.cgi, /var/www/apcupsd/upsfstats.cgi, /var/www/cgi-bin/apcgui(/.*)?, /var/www/apcupsd/multimon.cgi, /var/www/apcupsd/upsimage.cgi, /var/www/apcupsd/upsstats.cgi, /var/www/apcupsd/upsfstats.cgi PROCESS TYPES
SELinux defines process types (domains) for each process running on the system You can see the context of a process using the -Z option to ps Policy governs the access confined processes have to files. SELinux httpd_apcupsd_cgi_script policy is very flexible allowing users to setup their httpd_apcupsd_cgi_script processes in as secure a method as possible. The following process types are defined for httpd_apcupsd_cgi_script: httpd_apcupsd_cgi_script_t Note: semanage permissive -a httpd_apcupsd_cgi_script_t can be used to make the process type httpd_apcupsd_cgi_script_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. BOOLEANS
SELinux policy is customizable based on least access required. httpd_apcupsd_cgi_script policy is extremely flexible and has several bool- eans that allow you to manipulate the policy and run httpd_apcupsd_cgi_script with the tightest access possible. If you want to deny any process from ptracing or debugging any other processes, you must turn on the deny_ptrace boolean. Enabled by default. setsebool -P deny_ptrace 1 If you want to allow all domains to use other domains file descriptors, you must turn on the domain_fd_use boolean. Enabled by default. setsebool -P domain_fd_use 1 If you want to allow all domains to have the kernel load modules, you must turn on the domain_kernel_load_modules boolean. Disabled by default. setsebool -P domain_kernel_load_modules 1 If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. setsebool -P fips_mode 1 If you want to enable reading of urandom for all domains, you must turn on the global_ssp boolean. Disabled by default. setsebool -P global_ssp 1 If you want to allow httpd cgi support, you must turn on the httpd_enable_cgi boolean. Disabled by default. setsebool -P httpd_enable_cgi 1 If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default. setsebool -P nis_enabled 1 If you want to allow confined applications to use nscd shared memory, you must turn on the nscd_use_shm boolean. Disabled by default. setsebool -P nscd_use_shm 1 MANAGED FILES
The SELinux process type httpd_apcupsd_cgi_script_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. httpd_apcupsd_cgi_rw_content_t FILE CONTEXTS
SELinux requires files to have an extended attribute to define the file type. You can see the context of a file using the -Z option to ls Policy governs the access confined processes have to these files. SELinux httpd_apcupsd_cgi_script policy is very flexible allowing users to setup their httpd_apcupsd_cgi_script processes in as secure a method as possible. STANDARD FILE CONTEXT SELinux defines the file context types for the httpd_apcupsd_cgi_script, if you wanted to store files with these types in a diffent paths, you need to execute the semanage command to sepecify alternate labeling and then use restorecon to put the labels on disk. semanage fcontext -a -t httpd_apcupsd_cgi_script_exec_t '/srv/httpd_apcupsd_cgi_script/content(/.*)?' restorecon -R -v /srv/myhttpd_apcupsd_cgi_script_content Note: SELinux often uses regular expressions to specify labels that match multiple files. The following file types are defined for httpd_apcupsd_cgi_script: httpd_apcupsd_cgi_script_exec_t - Set files with the httpd_apcupsd_cgi_script_exec_t type, if you want to transition an executable to the httpd_apcupsd_cgi_script_t domain. Paths: /var/www/cgi-bin/apcgui(/.*)?, /var/www/apcupsd/multimon.cgi, /var/www/apcupsd/upsimage.cgi, /var/www/apcupsd/upsstats.cgi, /var/www/apcupsd/upsfstats.cgi Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels. COMMANDS
semanage fcontext can also be used to manipulate default file context mappings. semanage permissive can also be used to manipulate whether or not a process type is permissive. semanage module can also be used to enable/disable/install/remove policy modules. semanage boolean can also be used to manipulate the booleans system-config-selinux is a GUI tool available to customize SELinux policy settings. AUTHOR
This manual page was auto-generated using sepolicy manpage . SEE ALSO
selinux(8), httpd_apcupsd_cgi_script(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) , setsebool(8) httpd_apcupsd_cgi_script 14-06-10 httpd_apcupsd_cgi_script_selinux(8)
All times are GMT -4. The time now is 12:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy