|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
FreeBSD Administration Commands
I've started this thread to aid both new and existing user in the administration of FreeBSD systems.
Please don't make this thread too chatty and only put helpful commands.
__________________
"No, that's wrong, Cartman. But don't worry, there are no stupid answers, just stupid people." -- Mr. Garrison Forum Netiquette |
|
|||
adduser(8) - a script to aid the addition of new users
watch(8) - snoop on another tty line. An administrator can watch ( and interact ) with tty sessions. I use this to watch ssh users on my boxes feh(1) - image viewer and cataloguer import(1) - import - saves any visible window on an X server and outputs it as an image file. You can capture a single window, the entire screen, or any rectangular portion of the screen.
__________________
"No, that's wrong, Cartman. But don't worry, there are no stupid answers, just stupid people." -- Mr. Garrison Forum Netiquette |
|
|||
camcontrol To add/remove SCSI devices on runtime
script The script utility makes a typescript of everything printed on your ter- minal. It is useful for students who need a hardcopy record of an inter- active session as proof of an assignment. tcptraceroute Check which hop/router in path is blocking your tcp segments. /usr/ports/net/tcptraceroute |
|
||||
|
|
||||
People should also note any thing they mention, that is not included in the base install as being so.
pw -- create, remove, modify & display system users and groups That is the single best command I have ever encountered for taking care of such jobs !!!! vi -- standard screen editor on all unix systems (this is NOT vim). vipw -- safely edit the systems passwd file using your $EDITOR, default is vi -> check the handbooks chapter on 'shells' or your shells manual for details on setting your default screen editor. If no $EDITOR or $VISUAL are set, it uses /usr/bin/vi to edit the file. pwd_mkdb -- generate the password databases, very useful if you ever edit the file without using the vipw program. portupgrade -- a useful utility in ports for installing and updating programs (I don't use it, but many do I think). sh -- the systems /bin/sh, great for writing scripts, THIS IS NOT BASH. test -- great manual page for those doing shell scripting. perl and related manual pages, Perl can be installed from ports and is a great tool if one needs a best friend. awk -- pattern-directed scanning and processing language, great language to learn whether you use Perl or not. THIS IS NOT GAWK, if GNU AWK is needed, install it from ports. hier -- map of the file system. dump and restore -- great backup tools tar -- tape archive managing program, this is not GNU tar so check your GNU'isms at --the-manual if the switches are different (I've never used gtar and rarely use the GNU style options of bsd tar). Install gtar from ports if you need GNU tar. tar, gzip, bzip2, dump, and lzma are my favorite backup programs. psearch a great utility you can install from ports/pkg for searching the local ports tree. csup -- useful for dealing with ports and source code, check the handbook for details. -> install via ports if using older versions of FreeBSD.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
sudo, to give specified users certain rights. (/usr/ports/security/sudo)
visudo, installed with sudo, a vi-editor (which can be changed) that will edit the sudoers file and also check for syntax errors.) lsftp (/usr/ports/ftp/lftp) a very simple yet versatile text ftpclient. screen (/usr/ports/sysutils/screen) an incredibly useful program http://www.scottro.net/qnd/qnd-screen.html gives quick rundown of some of its uses. |
|
||||
gstat(8) - prints nice output of currently used filesystems/partitions [ gstat ]
netstat(8) - great tool for checking network deamons listening ports, number fo packets and buffers [ netstat -ib | netstat -Lan | netstat -m] diskinfo(8) - get info about disks, also benchmark them in hdparm(8) style [ diskinfo | diskinfo -c ad0 | diskinfo -t ad0 ] iostat(8) - displays current disks usage, reads per second, transactions per second and so [ iostat 1 | iostat -x 5 ]
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|||
Basic but took me a few hours.
reboot - reboots the system shutdown -p now - Powers down the system rather than halting it. df -h - Shows the amount of disk free in a human readable format. |
|
|||
screen -- A great tool for remote or console administration. Not BSD specific.
|
|
|||
I second screen. Invaluable when rebuilding kernel/world over a remote connection.
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident! |
|
||||
sockstat(1) - Gather information about sockets (sockstat -c4 | grep ^www | awk '{print $7}' | cut -d: -f1 | sort | uniq -c | sort +1n)
strace(1) (devel/strace) - Useful for tracing process execution (similar to truss(1)) lsof(8) (sysutils/lsof) - List opened files / sockets by programs (lsof /dev/dsp0 - who's that bastard blocking my sounds!??!, similar to fstat(1)) iftop(8) (net-mgmt/iftop) - Display live information about network bandwidth usage by interface and host. tcpdump(1) - totally awsome tool for network debugging and sniffing. Also check wireshark (net/wireshark). |
|
||||
/usr/ports/net/trafshow - Light, easy, flexible traffic monitoring
pfctl(8) - pf's uber switch
__________________
BSD, Eggdrop and the random Blah |
|
|||
The basic commands for user management:
* chpass(1) <= Add or change user database information * login(1) <= Login user, invoked by getty * passwd(1) <= Modify user's password, using login class' settings * finger(1) <= Display user information * adduser(8) <= Add a new user interactively or in batch mode * pw(8) <= Add, modify, delete users and groups * vipw(8) <= Directly edit the password database * pwd_mkdb(8) <= Generate password databases (used by chpass, passwd, etc) * rmuser(8) <= Remove user and his files * pam_passwdqc(8) <= Optional password quality check PAM module for passwd * passwd(5) <= User database without passwords * master.passwd(5) <= User database with passwords, class, change and expire settings * login.access(5) <= Login access control table (who, from where) * login.conf(5) <= Defines resource limits, environment, authentication options * netgroup(5) <= Defines groups (host, user, domain) * adduser.conf(5) <= Default settings for adduser * pw.conf(5) <= Default settings for pw Although not really commands - when dealing with users and groups one should know: Group wheel:
Last edited by Darwimy; 10th June 2008 at 08:49 PM. |
Tags |
administration, commands, freebsd, newbie |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
No DRI + GLX commands? | Hrr4 | FreeBSD General | 5 | 21st September 2008 10:05 AM |
BSD UNIX Toolbox: 1000+ Commands for FreeBSD, OpenBSD and NetBSD | anomie | Book reviews | 8 | 28th July 2008 09:32 PM |
How have you guys learned Unix administration? | bigb89 | Off-Topic | 13 | 11th July 2008 03:40 PM |
Cisco IOS commands ?? | jb_daefo | Off-Topic | 7 | 5th June 2008 01:53 AM |
Network Administration with FreeBSD 7 | faustcoder | Book reviews | 0 | 14th May 2008 03:01 PM |