Monitoring users - I

0 comments

MONITORING USERS-I
User-management is always one of the basic tasks for Linux administrators, here we are going to see some basics user related "Monitoring Commands".

1) "finger" is a command which will give full details about user properties such as name, login, shell what he is using etc.

Syntax:

#finger username

Example:
[root@localhost ~]# finger root
Login: root Name: root
Directory: /root Shell: /bin/bash
On since Sat Jun 6 19:20 (EDT) on tty1 4 hours 12 minutes idle
On since Sun Jun 7 02:18 (EDT) on pts/0 from :0.0
On since Sun Jun 7 03:48 (EDT) on pts/1 from :0.0
16 minutes 9 seconds idle
New mail received Sun Jun 7 04:02 2009 (EDT)
Unread since Sat Jun 6 22:17 2009 (EDT)
No Plan.

Here you can see so many user related information
one security information you can see is when he loged in last time and from where he loged in etc.

2)"id" is one more command which will show the user details such as his primary group and his secondary group.

Syntax:

#id username

Example:

[root@localhost ~]# id root
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t:SystemLow-SystemHigh
[root@localhost ~]#


3)"chage" is one more command which is used to see user related "threshold details" such as user disable time etc.

Syntax:

#chage -l username

Example:

[root@localhost ~]# chage -l root
Last password change : Jun 06, 2009
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
[root@localhost ~]#

4)"who" is one more command to see who other people logged in and from where they logged in.

Syntax:
#who

Example:

[root@localhost ~]# who
root tty1 2009-06-06 19:20
root pts/0 2009-06-07 02:18 (:0.0)
root pts/1 2009-06-07 03:48 (:0.0)
[root@localhost ~]#

5)"w" is one more command which is similar to "who" command but will give some more details.

Example:

[root@localhost ~]# w
06:36:49 up 11:23, 3 users, load average: 0.54, 0.38, 0.42
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 - 19:20 4:27m 0.69s 0.69s -bash
root pts/0 :0.0 02:18 0.00s 0.16s 0.02s w
root pts/1 :0.0 03:48 31:25 0.10s 0.10s bash
[root@localhost ~]#

6)"groups" is one more wonderful command which will show which user belongs to what groups, we can say its a subset of id command

Syntax:

#groups username

Example:

[root@localhost ~]# groups root
root : root bin daemon sys adm disk wheel
[root@localhost ~]#

7)"users" is one more monitoring command to see which users loged in at present in to the system

Example:

[root@localhost ~]# groups root
root : root bin daemon sys adm disk wheel
[root@localhost ~]#

Please add if you know some other user related monitoring commands.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • RAID01 Vs RAID10

    0 comments

    So what is the difference between RAID01 and RAID10?
    This is bit tricky question, Recently I came to know about this one in an interview. so do both are same?
    No both are not same.

    When we are dealing with RAID01 we are actually implementing RAID0 first then RAID1 on it. Ok little bit confused?
    Let me put it in this way RAID0 is nothing but stripeset writing of data and RAID1 is Mirring of data on to disks.For example lets take 8 disks, so first we are writing whole data on 4 disks then we are mirring it on to remaining disks.
    Where as in RAID10 we are first mirring disk and then striping data on mirrered disks
    In general RAID01 is "a mirrior of 2 strips" and RIAD10 is "a single strip on mirrered disks"

    So here one more question arises... which one is good?
    RAID10 is good, the difference is that the chance of system failure with two drive failures in a RAID 0+1 system with two sets of drives is (n/2)/(n - 1) where "n" is the total number of drives in the system. The chance of system failure in a RAID 1+0 system with two drives per mirror is 1/(n - 1). So, using the 8 drive systems shown in the diagrams, the chance that loosing a second drive would bring down the RAID system is 4/7 with a RAID 0+1 system and 1/7 with a RAID 1+0 system.

    Reblog this post [with Zemanta]

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Linux interview questions :FTP

    6 comments

    LINUX INTERVIEW QUESTIONS : FTP

    One of my friend asked me why there is no answers for So many interview questions, basically most of the interview questions which are on this site are the interviews which happened to me so. At that time I am not able to Answer some of the questions, so from today on words I will try to post all the interview questions with answers, If you feel these answers are wrong you can feel free to comment with proof so that i can modify my posts.

    1)What is the difference between TFTP and FTP servers?
    A)Both are file transfer servers but slight difference is TFTP server uses UDP protocol and FTP uses TCP protocol. TFTP is good for slow connection paths.

    2)What is the port no for FTP?
    A)20 for Data and 21 for Control(normally when an interviewer ask's ftp port number just say 21.

    3)What is the port no for TFTP?
    A)69.

    4) How to restrict users to their home directories?
    A)
    By setting up "chroot_local_user=YES".


    5)How to restrict total number of users accessing FTP server?
    A1)
    If Vsftpd is running under xinted service, then you can use xineted to get per-service per IP connection limits or
    A2) If you run vsftpd in "standalone" mode with the "setting listen=YES", then
    you can investigate the setting (e.g.) : "max_clients=10"


    6)I want to copy multiple files with out prompting for any info, how can I do that one?
    A)Simply do "ftp -i ftpserver" this command will suppress any info displayed on ftp server.
    or you can just type prompt ftp prompt to suppress info messages have a look here.

    7) Some times Local users cannot log in. How to resolve this issue?
    A)
    Check "local_enable=YES" in your /etc/vsftpd/vsftpd. conf to allow local users to log in.

    8) How do we integrate with LDAP( Lightweight Directory Access Protocol )users and login?
    A)
    Use vsftpd's( Very Secure FTPD) PAM(Pluggable Authentication Modules) integration to do this, and have PAM authenticate against an LDAP repository.


    9) Can we host different ftp sites on single machine, I mean virtual hosting concept like Apache?
    A1)
    Yes. If you integrate vsftpd with xinetd, you can use xinetd to bind to several different IP addresses. For each IP address, get xinetd to launch vsftpd with a different config file. This way, you can get different behavior per virtual address.
    A2) Alternatively, run as many copies as vsftpd as necessary, in standalone
    mode. Use "listen_address=x.x.x.x" to set the virtual IP.


    10) How to restrict different users with different permissions in vsftpd
    A) By setting up "user_config_dir" entry in "vsftpd.conf".


    11)How to change vsftpd default port?
    A)By setting "listen_port" option in "vsftpd.conf".

    12) Vsftpd is reporting times as GMT times and not local times!. How to resolve this?
    A)
    This behavior can be changed with the setting "use_localtime=YES".



    13) How to disable certain FTP commands?
    A) There are some individual settings (e.g. dirlist_enable) or you can specify a complete set of allowed commands with "cmds_allowed".


    14) How does vsftpd support per-IP limits?
    A1)
    If you are running vsftpd standalone, there is a "max_per_ip" setting.
    A2) Yes. If you are running vsftpd via xinetd, there is an xinetd config variable "per_source".


    15) How Does vsftpd can do bandwidth limiting?
    A)
    settings such as "anon_max_rate" and "local_max_rate" can be used to set this limits.


    16) How to restrict some IP's not use my FTP server?
    A1)
    vsftpd can integrate with tcp_wrappers (if built with this support). It is enabled with the setting "tcp_wrappers=YES".

    17) Does vsftpd support IPv6?
    A)
    Yes, as of "version 1.2.0".


    18) Help! I'm getting messages along the lines of "500 OOPS: vsf_sysutil_bind" when trying to do downloads (particularly lots of small files).
    A) "vsftpd-1.2.1"
    should sort this out.


    19) Can we use vsftpd to hiding or denying certain files?
    A)
    Yes. Look at the hide_file and deny_file options.


    20)How you can check if there is any syntax error in vsftpd.conf file?
    A)Just type vsftpd with out quoats.


  • Like the post? Please Subscribe to free RSS feed to get updates
  • Archive

    Translate this page

     

    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here