![]() The default limits on login are set in /etc/nf. Use the command limits in csh or tcsh or as in Linux, use ulimit in an sh or bash shell. # cat /proc/sys/fs/file-nr # How many file descriptors are in use # echo "1024 50000" > /proc/sys/net/ipv4/ip_local_port_range # port rangeįs.file-max=102400 # Permanent entry in nf # sysctl fs.file-max=102400 # Change max open files limit # sysctl fs.file-max # View max open files limit For example:Īsterisk hard nofile 409600 # Limit application open files Login users and applications can be configured in /etc/security/nf. The ulimit command can be used in a script to change the limits for the script only. # ulimit -n 10240 # This is only valid within the shell For example to change the open files limit from 1024 to 10240 do: Some application require higher limits on open files and sockets (like a proxy web server, database). # echo "Sorry no login now" > /var/run/nologin # (FreeBSD) # echo "Sorry no login now" > /etc/nologin # (Linux) The message in nologin will be displayed (might not work with ssh pre-shared keys). To temporarily prevent logins system wide (for all users but root) use nologin. If the master.passwd is modified manually (say to delete a password), run # pwd_mkdb -p master.passwd to rebuild the database. # pw useradd colin -c "Colin Barschel" -g admin -m -s /bin/tcshĮncrypted passwords are stored in /etc/shadow for Linux and Solaris and /etc/master.passwd on FreeBSD. # pw groupmod admin -m newmember # Add a new member to a group # rmuser joe # FreeBSD delete user joe (interactive) # adduser joe # FreeBSD add user joe (interactive) # userdel colin # Delete user colin (Linux/Solaris) # groupmod -A # Add existing user to group (SuSE) # usermod -a -G # Add existing user to group (Debian) # useradd -c "Colin Barschel" -g admin -m colin # groupadd admin # Add group "admin" and user colin (Linux/Solaris) # id # Show the active user id with login and group # tail /var/log/warn # System warnings messages see nf # tail -n 500 /var/log/messages # Last 500 kernel/syslog messages # systat -iostat 1 # BSD CPU and and disk throughput # systat -ifstat 1 # BSD network traffic through active interfaces # systat -netstat 1 # BSD active network connections # systat -tcp 1 # BSD tcp connections (try also -ip) # systat -vmstat 1 # BSD summary of system statistics (1 s intervals) # iostat 2 # display I/O statistics (2 s intervals) # vmstat 2 # display virtual memory statistics # mpstat 1 # display processors related statistics # top # display and update the top cpu processes The following commands are useful to find out what is going on on the system. # camcontrol devlist -v # Show SCSI devices # sysctl -a | grep mem # Kernel memory settings and info # sysctl hw.ncpu # number of active CPUs installed # sysctl hw # Gives a lot of hardware information # dmidecode # Show DMI/SMBIOS: hw info from the BIOS # lshal # Show a list of all devices with their properties # free -m # Used and free memory (-m for MB) # watch -n1 'cat /proc/interrupts' # Watch changeable interrupts continuously ![]() # grep MemTotal /proc/meminfo # Display the physical memory # dd if=/dev/mem bs=1k skip=768 count=256 2>/dev/null | strings -n 8 # Read BIOS # lsdev # information about installed hardware # dmesg # Detected hardware and boot messages # last reboot # Show system reboot history # man hier # Description of the file system hierarchy # hostname -i # Display the IP address of the host. # uptime # Show how long the system has been running + load Use /etc/DISTR-release with DISTR= lsb (Ubuntu), redhat, gentoo, mandrake, sun (Solaris), and so on. # cat /etc/debian_version # Get Debian version # cat /etc/SuSE-release # Get SuSE version # lsb_release -a # Full release info of any LSB distribution ![]() # uname -a # Get the kernel version (and BSD version) Hardware | Statistics | Users | Limits | Runlevels | root password | Compile kernel | Repair grub ![]() Some rights reserved under Creative Commons. See also the about page.Įrror reports and comments are most welcome - Colin Barschel. This XHTML page can be converted into a nice PDF document with a CSS3 compliant application (see the script example). On a duplex printer the booklet will create a small book ready to bind. The latest version of this document can be found at. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing. This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |