Sponsored Content
Top Forums Shell Programming and Scripting How to enforce user to Enter text when login to a UNIX / Linux system? Post 303001820 by mohtashims on Friday 11th of August 2017 03:45:25 PM
Old 08-11-2017
Tools

Quote:
Originally Posted by Corona688
You realize, of course, anyone can go and trash /tmp/root_log/logs_$tdate ?
Yes, i m testing this out. once good with the scripts i will change the log location.

Thank you for your attention though.

---------- Post updated at 02:45 PM ---------- Previous update was at 02:40 PM ----------

Quote:
Originally Posted by RudiC
How about using a "restricted shell"? man bash:

Or, in your above "injection", did you consider trapping the relevant signals?

Based on your suggestions, I tried the below in tracklogin.sh

Code:
trap "echo Bye Bye ...; exit; exit" 2

But when i login i get the below error for tracklogin.sh

Code:
bash: ./tracklogin.sh: restricted: cannot specify `/' in command names

Can you tell me how i can overcome this error?

i then decided to run tracklogin.sh in debug mode i see the below output:

Code:
bash -x tracklogin.sh
++ date +%d%m%y
+ tdate=110817
+ mkdir -p /tmp/root_log
+ chmod -R 777 /tmp/root_log
++ id
++ date
+ echo User 'uid=51371(user1)' 'gid=24(webuser)' logged in at:Fri Aug 11 14:36:28 CDT 2017
+ trap 'echo Bye Bye...; exit; exit' 2
+ read -p 'Enter Reason for Login:' reason
Enter Reason for Login:^C++ echo Bye Bye...
Bye Bye...
++ exit

It seems to catch the trap but how do i force the user out of the system ?
 

9 More Discussions You Might Find Interesting

1. HP-UX

Hp-Unix user login file collection

Dear All, how to check the unix log file which mean how many(who) user has been log in the server for the day, when they log in & when they log out? (8 Replies)
Discussion started by: whl123
8 Replies

2. Solaris

How to check the last login user were doing in the system

Hi, I'm new to solaris/ Unix and would like to know how to check in the system what was the last login user were doing. Is there any way to check this? Thanks in advanced. (1 Reply)
Discussion started by: raziayub
1 Replies

3. UNIX for Dummies Questions & Answers

How can i enter to another system using linux...

I m using linux os...and my friend using windows....we both having internet connection...Is there any possible to enter his system from my system using this internet connection..... (1 Reply)
Discussion started by: stalin2020
1 Replies

4. SCO

Help adding user login in Unix Sco

We have made numerous requests to our system administrator to add new employees at login screen ( passwords not required ) to no avail. I can login into root but not sure how to proceed from there. We have a 10 yr. old version of SCO Can anyone help? I know very few unix commands okay... (1 Reply)
Discussion started by: houseostyle
1 Replies

5. UNIX for Dummies Questions & Answers

System list of all UNIX login accounts

What is the command to list all UNIX system login accounts? What is the command to list all system password parameters for UNIX(minimum length, complexity,age, invalid lockout attempts, expiration date , user inactivity lockout) (1 Reply)
Discussion started by: ma466
1 Replies

6. Solaris

How to enforce login as specific user in Solaris

Hi, I need to implement something that will enforce login to a Solaris server as a particular, specifed user. After this login stage, users will be able to "su -" to whichever user they wish, by which time their activity will be captured by some sort of script (yet to be written). What I need... (7 Replies)
Discussion started by: jamiegeo1
7 Replies

7. UNIX for Dummies Questions & Answers

Unix user login class

Hello - Could anyone please explain what is login class in unix..? is it supported by Linux, AIX, HP-UX, Solaris? Also how do we update this when a user is created? I looked into man pages for useradd/usermod and mkuser, but could not find any option to add/update login class for a user. ... (5 Replies)
Discussion started by: manju--
5 Replies

8. AIX

Successful user login, yet system claims invalid info

I have four AIX 6.1.7.4 systems freshly built and ready for our DBAs to do their work. Of the three one runs into an odd issue while logging in as himself, using Putty with ssh protocols. He logs in successfully, but also gets the following error message: : 3004-300 You entered an invalid login... (2 Replies)
Discussion started by: Mike Brendan
2 Replies

9. UNIX and Linux Applications

Help with AT&T UNIX SYSTEM V Version 4 Console Login

Hello I install AT&T UNIX System V Release 4 Version 2.1 (3.5) on Emulator Bochs 2.6.8 here I done with all Base .img file upload after uploading 10 the base img file System take restart and after that System ask for console Login. which is as root and password set by me. But it will NOT allow... (7 Replies)
Discussion started by: Akshay Nalange
7 Replies
DateTime::Locale::fil(3)				User Contributed Perl Documentation				  DateTime::Locale::fil(3)

NAME
DateTime::Locale::fil SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'fil' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Filipino. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) Lunes Martes Miyerkules Huwebes Biyernes Sabado Linggo Abbreviated (format) Lun Mar Mye Huw Bye Sab Lin Narrow (format) L M M H B S L Wide (stand-alone) Lunes Martes Miyerkules Huwebes Biyernes Sabado Linggo Abbreviated (stand-alone) Lun Mar Mye Huw Bye Sab Lin Narrow (stand-alone) L M M H B S L Months Wide (format) Enero Pebrero Marso Abril Mayo Hunyo Hulyo Agosto Setyembre Oktubre Nobyembre Disyembre Abbreviated (format) Ene Peb Mar Abr May Hun Hul Ago Set Okt Nob Dis Narrow (format) E P M A M H H A S O N D Wide (stand-alone) Enero Pebrero Marso Abril Mayo Hunyo Hulyo Agosto Setyembre Oktubre Nobyembre Disyembre Abbreviated (stand-alone) Ene Peb Mar Abr May Hun Hul Ago Set Okt Nob Dis Narrow (stand-alone) E P M A M H H A S O N D Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated BCE CE Narrow BCE CE Date Formats Full 2008-02-05T18:30:30 = Martes, Pebrero 05 2008 1995-12-22T09:05:02 = Biyernes, Disyembre 22 1995 -0010-09-15T04:44:23 = Sabado, Setyembre 15 -10 Long 2008-02-05T18:30:30 = Pebrero 5, 2008 1995-12-22T09:05:02 = Disyembre 22, 1995 -0010-09-15T04:44:23 = Setyembre 15, -10 Medium 2008-02-05T18:30:30 = Peb 5, 2008 1995-12-22T09:05:02 = Dis 22, 1995 -0010-09-15T04:44:23 = Set 15, -10 Short 2008-02-05T18:30:30 = 2/5/08 1995-12-22T09:05:02 = 12/22/95 -0010-09-15T04:44:23 = 9/15/-10 Default 2008-02-05T18:30:30 = Peb 5, 2008 1995-12-22T09:05:02 = Dis 22, 1995 -0010-09-15T04:44:23 = Set 15, -10 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = Martes, Pebrero 05 2008 18:30:30 UTC 1995-12-22T09:05:02 = Biyernes, Disyembre 22 1995 09:05:02 UTC -0010-09-15T04:44:23 = Sabado, Setyembre 15 -10 04:44:23 UTC Long 2008-02-05T18:30:30 = Pebrero 5, 2008 18:30:30 UTC 1995-12-22T09:05:02 = Disyembre 22, 1995 09:05:02 UTC -0010-09-15T04:44:23 = Setyembre 15, -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = Peb 5, 2008 18:30:30 1995-12-22T09:05:02 = Dis 22, 1995 09:05:02 -0010-09-15T04:44:23 = Set 15, -10 04:44:23 Short 2008-02-05T18:30:30 = 2/5/08 18:30 1995-12-22T09:05:02 = 12/22/95 09:05 -0010-09-15T04:44:23 = 9/15/-10 04:44 Default 2008-02-05T18:30:30 = Peb 5, 2008 18:30:30 1995-12-22T09:05:02 = Dis 22, 1995 09:05:02 -0010-09-15T04:44:23 = Set 15, -10 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 Mar 1995-12-22T09:05:02 = 22 Bye -0010-09-15T04:44:23 = 15 Sab Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = Mar, 2-5 1995-12-22T09:05:02 = Bye, 12-22 -0010-09-15T04:44:23 = Sab, 9-15 MMM (LLL) 2008-02-05T18:30:30 = Peb 1995-12-22T09:05:02 = Dis -0010-09-15T04:44:23 = Set MMMd (MMM d) 2008-02-05T18:30:30 = Peb 5 1995-12-22T09:05:02 = Dis 22 -0010-09-15T04:44:23 = Set 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = Mar Peb 5 1995-12-22T09:05:02 = Bye Dis 22 -0010-09-15T04:44:23 = Sab Set 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = Pebrero 5 1995-12-22T09:05:02 = Disyembre 22 -0010-09-15T04:44:23 = Setyembre 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = Mar Pebrero 5 1995-12-22T09:05:02 = Bye Disyembre 22 -0010-09-15T04:44:23 = Sab Setyembre 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (yyyy-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -010-9 yMEd (EEE, yyyy-M-d) 2008-02-05T18:30:30 = Mar, 2008-2-5 1995-12-22T09:05:02 = Bye, 1995-12-22 -0010-09-15T04:44:23 = Sab, -010-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 Peb 1995-12-22T09:05:02 = 1995 Dis -0010-09-15T04:44:23 = -10 Set yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = Mar, 2008 Peb 5 1995-12-22T09:05:02 = Bye, 1995 Dis 22 -0010-09-15T04:44:23 = Sab, -10 Set 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 Pebrero 1995-12-22T09:05:02 = 1995 Disyembre -0010-09-15T04:44:23 = -10 Setyembre yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyMM (yy-MM) 2008-02-05T18:30:30 = 08-02 1995-12-22T09:05:02 = 95-12 -0010-09-15T04:44:23 = -10-09 yyMMM (MMM yy) 2008-02-05T18:30:30 = Peb 08 1995-12-22T09:05:02 = Dis 95 -0010-09-15T04:44:23 = Set -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Lunes SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::fil(3)
All times are GMT -4. The time now is 08:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy