page1
Accounts
To create a new user account
# useradd <name>
To add/change a password
# passwd <name>
To Modify a user account
# usermod <name>
-u specific UID
-g specific GID
-d create home dir
-c User full name
-s Assign a Default Shell
# useradd jsmith -u 1010 -g 501 -d /home/users/jsmith -c “Joe Smith” -s /bin/bash
Example
-c Changes the user name
# usermod -c “Joe Smith” jsmith
-G add a user to a group
# usermod -G homeuser jsmith
-L Lock the user account
# usermod -L jsmith
-U Unlock the user account
# usermod -U jsmith
-s Change or set a shell
# usermod -s /bin/tcsh jsmith
Deleting User Accounts
# userdel <name>
Change a User Shell
# chsh -s /bin/<shell> <name>
OpenSUSE Community Resources
Main Website
http://opensuse.org
Download openSUSE
http://software.opensuse.org/
Support
Help http://en.opensuse.org/Portal:Support
Documents http://doc.opensuse.org/
Wiki http://en.opensuse.org/Main_Page
Video http://opensuse.blip.tv/
Forums http://forums.opensuse.org/
Mail List http://en.opensuse.org/openSUSE:Mailing_lists
IRC Chats http://en.opensuse.org/openSUSE:Mailing_lists
The chat rooms are on FreeNode Network...
Facebook http://www.facebook.com/group.php?gid=2256834487
Twitter/FriendFeed/identi.ca @openSUSE
Community Pages
Users https://users.opensuse.org/
Planet http://planet.opensuse.org/global/
News http://news.opensuse.org/
Lizards http://lizards.opensuse.org/
OpenSUSE-Community http://www.opensuse-community.org
Development
Deverloper Documentations http://en.opensuse.org/Portal:Development
Features https://features.opensuse.org/
Build Service https://build.opensuse.org/
Bugs http://en.opensuse.org/openSUSE:Submitting_bug_reports
SUSE Studio http://susestudio.com/
Boot Prompt Options
boot: linux start a install normally
boot: linux ssh=1 installer starts ssh server*
boot: linux vnc=1 installer starts a vnc server*
boot: linux rescue boot rescue mode
boot: memtest starts the Memtest86+ program
boot: single boots into single mode
Boot: vga=0x317 Set the video 1024x768
RPM
Installing an RPM
# rpm -ivh <package>
Upgrading an RPM
# rpm -Uvh <package>
Removing an RPM *
# rpm -e <package>
Detials about an install RPM
# rpm -qi <package>
List the contents of an RPM
# rpm -qlp <package>.rpm
List installed RPM'es
# rpm -qal
# rpm -qal | grep <package>
Example to find an installed RPM
To see what provides a command
# rpm -q –whatprovides <name>
.
├── bin
├── boot
├── dev
├── etc
├── home
├── lib
├── lost+found
├── media
├── mnt
├── opt
├── proc
├── root
├── sbin
├── selinux
├── srv
├── sys
├── tmp
├── usr
└── var
Show Every Process Currently Running
Every running Process
# ps -e
Every running Process, long listing
# ps -el
Every running Process, full-format listing
# ps -ef
Every running Process, Short BDS Style
# ps ax
Every running Process, Long BDS Style
# ps auwwx
List processes of current user at the Current shell
# ps
Show all processes ran by a uesers
Simple process
# ps -u username
With CPU/Memory
# ps -u usersname u
With PPID
# ps -fu user
Watch Active Processes
# top
-d 5 Changes update delay to 5 sec
-u userid Only show that useid
-b Run in non-interavite non-screen-oriented mode.
Process
Bin – contains useful commands that are used both user and administrators.
Boot – This directory contains the system.map file as well as the Linux kernel.
Dev – contains the special device files for all the devices.
Etc – This directory contains all the configuration files for your system.
Home – Linux is a multi-user environment so each user is also assigned a specific directory which is accessible only to them and the system administrator.
Lib – contains all the shared libraries that are required by system programs.
Media – Mount point for removeable media.
Mnt – a generic mount point.
Opt – contains all the software and add-on packages that are not part of the default installation.
Proc – filesystem is the de-facto standard Linux method for handling process and system information.
Root – Home directory of the user root.
Sbin – Contains all the binaries that are essential to the working of the system.
Selinux – pseudo-file system contains commands that are most commonly used by the kernel subsystem.
Srv – contains site-specific data which is served by this system.
Tmp – Temp Directory.
Usr – directory contains system files and directories that is shared by all users.
Var – Contains files to which the system writes data during the course of its operation.
Services*
List all Services
# service –status-all
Get a status on a Service
# service <name> status
Start a Service
# service <name> start
Stop a Service
# service <name> stop
Restart a Service
# service <name> restart
Do a full-restart on a Service
# service <name> --full-restart
# service –full-start <name>
Do a reload
# service <name> reload
File System Layout
YaST
Run YaST in QT Graphical Frontend
# yast --qt
Run YaST in gtk Graphical Frontend
# yast --gtk
Run YaST in text-mode frontend
# yast --ncurses
Install a Package with YaST
# yast -i <package>.rpm
Remove an Installed Package with YaST
# yast --remove <package>.rpm
List all available Module
# yast -l -or- yast --list
To obtain usage of a module
# yast <module> help
# echo $SHELL
Display all of the settings
# set | less
List Bash Settings
# env
To find a command you have ran
# ctrl-r <start typing the command>
To see who you are
Change directory
# whoami
# cd <directory>
To see history
# history
Log in as Superuser
# su -l
Go back the last directory
# cd -
To repeat the last command
# !!
To see the current time
# date
Watch a file
# tail -f <file>
To see what current shell is set
Display Dates by Month
# cal
Update System Time
# ntpdate pool.ntp.org
What kernel is running...
# uname -a
See what release running
# cat /etc/SuSE-release
Using the Shell
List all Network Devices
# ifconfig -a
Show the routes
# ifconfig -a
# route
# netstat -rn
Lists of all TCP Connections
# netstat -tanp
# ifconfig -a
To list all disk and partitions
# fdisk -l
To list for a specific disk
# fdisk -l /dev/<h/s>d<a-z>
List mounted file systems
# mount
# cat /proc/mounts
List only specifics system type
# mount -t <type>
List all mounted ext3 system type
# mount -t ext3
Mount partition
# mount -t <type> <device> <mount point>
Example Mount
# mount -t ext3 /dev/sda1 /mnt
Mount CD/DVD ISO as a loopback Device
# mount -t iso9960 -o loop name.iso <mount>
Example of mounting a saved iso as a loopback device
# mount -t iso9960 -o loop /tmp/opensuse-11.2-x86_64.iso /mnt
See status of loopback devices
# losetup -a
Unmount File Systems
# umount /dev/<device>
# umount /<mount point>
File Systems
* use when installing
Unmount A Busy Filesystem
# umount -l /<mount point>
Networking
# netstat -rn
# ip r
# route
Stop a network device
# ifconfig ethx down
Start a network device
# ifconfig ethx up
* With openSUSE you can find most services under /usr/sbin with rc in front. So you can the replace service with rc<name> <action>
example # /usr/sbin/rcapache2 restart
Zypper
Managing Zypper Repositories
# zypper flag options
lr – list all defined
repositories.
ar – adds a new repo
rr – removes a repo
nr – rename a repo
mr – modify a repo
ref – refresh all repo
clean – clean local cache
# yast --qt
# yast --qt
Install a package
# zypper in <package>
Remove a package
# zypper rm <package>
Very package integrity
# zypper ve <package>
Update Software
# zypper up
# zypper update
List available updates
# zypper lu
# zypper list-updates
Install need patches
# zypper patch
List Patches Needed
# zypper lp
# zypper list-patches
Perform a distrobution upgrade
# zypper dup
# zypper dist-upgrade
Search
# zypper se
# zypper search
Information on a package
# zypper if <package>
# zypper info <package>
What provides a package
zypper Usage:
zypper [--global-options] <command> [--command-options][arguments]
# zypper wp <package>
# zypper what-provides <package>
View hostname
# hostname -f
Scan interface for wireless
# iwconfig
Lists of all TCP Connections
# netstat -tanp
Search Host
# Dig <hostname>
See of a host is a live
# Ping <hostname>
Remote Access
SSH
# ssh user@host
SSH X Forwarding
Mount with sshfs
# sshfs user@host:/directory /<mount point>
# ssh -X user@host
Remote Desktop to Windows Desktop
# rdesktop <hostname> -u <username> -p <password>
VNC Client
# vncviewer hostname:x
VNC Client with SSH
# ssh -L 5901:localhost:5901 hostname