DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 3rd June 2008
corey_james corey_james is offline
Uber Geek
 
Join Date: Apr 2008
Location: Brisbane, Australia
Posts: 238
Thanked 4 Times in 10 Posts
Default 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
Reply With Quote
  #2   (View Single Post)  
Old 3rd June 2008
corey_james corey_james is offline
Uber Geek
 
Join Date: Apr 2008
Location: Brisbane, Australia
Posts: 238
Thanked 4 Times in 10 Posts
Default

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
Reply With Quote
  #3   (View Single Post)  
Old 3rd June 2008
osman osman is offline
Real Name: osman
New User
 
Join Date: May 2008
Location: Lahore, Pakistan
Posts: 9
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4   (View Single Post)  
Old 3rd June 2008
harisman's Avatar
harisman harisman is offline
Fdisk Soldier
 
Join Date: May 2008
Location: Hellas (Greece)
Posts: 66
Thanked 5 Times in 4 Posts
Default

write Send message to another logged user
lastcomm Watch all executed commands with details, when process accounting is enabled
pr It may be used for beautifying the text output. Useful when getting piped input from other command.
Reply With Quote
  #5   (View Single Post)  
Old 4th June 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

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''.
Reply With Quote
  #6   (View Single Post)  
Old 4th June 2008
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
Spam Deminer
 
Join Date: Apr 2008
Location: NYC
Posts: 322
Thanked 31 Times in 25 Posts
Default

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.
Reply With Quote
  #7   (View Single Post)  
Old 4th June 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

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
Reply With Quote
  #8   (View Single Post)  
Old 5th June 2008
tad1214 tad1214 is offline
Real Name: Thomas Donnelly
Fdisk Soldier
 
Join Date: Jun 2008
Location: Houston, TX
Posts: 60
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #9   (View Single Post)  
Old 6th June 2008
davidgurvich davidgurvich is offline
Fdisk Soldier
 
Join Date: May 2008
Location: NYC
Posts: 57
Thanked 3 Times in 3 Posts
Default

screen -- A great tool for remote or console administration. Not BSD specific.
Reply With Quote
Old 6th June 2008
cajunman4life cajunman4life is offline
Real Name: Aaron Graves
Package Pilot
 
Join Date: May 2008
Location: Coolidge, Arizona
Posts: 203
Thanked 16 Times in 14 Posts
Default

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!
Reply With Quote
Old 6th June 2008
deemon's Avatar
deemon deemon is offline
Fdisk Soldier
 
Join Date: May 2008
Location: Estonia
Posts: 50
Thanked 6 Times in 5 Posts
Default

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).
Reply With Quote
Old 7th June 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

Quote:
Originally Posted by tad1214 View Post
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.
We really should be pointing people away from directly using halt and reboot. They don't do a lot of safety checks.

shutdown should be used to halt (-h), poweroff (-p), or reboot (-r) a running system.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Old 10th June 2008
mish's Avatar
mish mish is offline
Port Guard
 
Join Date: May 2008
Location: Makati City, Philippines
Posts: 25
Thanked 0 Times in 0 Posts
Default

/usr/ports/net/trafshow - Light, easy, flexible traffic monitoring
pfctl(8) - pf's uber switch
Reply With Quote
Old 10th June 2008
Darwimy Darwimy is offline
Port Guard
 
Join Date: Jun 2008
Location: Germany
Posts: 36
Thanked 2 Times in 2 Posts
Default

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:
  • Only wheel members may use su to login as root.
Group operator:
  • May execute shutdown.
  • May directly read / write disk devices.
  • May create filesystem snapshots
Group dialer:
  • May access serial devices (”/dev/cuaa*”).
  • May start pppd.
Group network:
  • May execute ppp.
  • May execute sliplogin.

Last edited by Darwimy; 10th June 2008 at 08:49 PM.
Reply With Quote
Reply

Tags
administration, commands, freebsd, newbie

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT. The time now is 03:00 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick