stevepedwards.com/DebianAdmin linux mint IT admin tips info

Old Front Page

What's with the QR code background? Point your Phone QR Scanner at it to find out then read the Post.

----------------------------------------------------------------------------------------------------------------------------------------------
July 2015: *This is a personal requirements for Mint: post first install additions as samba, rsync et al are already in:
sudo apt-get update && apt-get upgrade
sudo apt-get install ssh nmap vim automake autoconf module-assistant x11vnc nbtscan locate libnss-winbind winbind g++ libcurl3 libssl0.9.8 chkrootkit rkhunter gparted testdisk hardinfo

For PCs requiring proprietary CPU/VGA like AMD and Nvidia, try:

sudo apt-get install amd64-microcode

sudo apt-get install linux-firmware-nonfree nvidia-common

sudo apt-get install fglrx-updates fglrx fglrx-core fglrx-updates-core 

sudo driver-manager

sudo sensors-detect

For Intel VGA try:

sudo apt-get install intel-microcode intel-gpu-tools

*g++ is required for ddrescue zip package make install from gnu.org

*winbind and libs required for pinging/mounting Win/Lin PCs by name (not xxx.local) with /etc/nsswitch "wins" line:

hosts: files wins mdns4_minimal [NOTFOUND=return] dns

*libcurl3 is required for google-chrome

*libssl0.9.8 is required for cav antivirus

*libav-tools/mplayer as possible h264 players/stream receivers of PiCam netcat video pipes

*fswebcam for testing v4l2 compatible webcams

--------------------------------------------------------------------------------------------------------------------------

April 7, 2014: This site will be a recap on Linux mainly - but will cover other IT topics too - to see what is new and improved (or not!) in the last few years I haven't done anything much in this field.

This page can be seen as an exercise in understanding how Linux can be tailored to suit what you may want in YOUR OS, not just what is included in a generic Desktop install disk from other system providers, so can be tailored to suit a smaller hard drive, with low memory for example (I have this install on an 8GB pen drive without openoffice.org).

I assume some prior knowledge from these pages onward, so...if you are COMPLETELY new to Linux, go to the Old Pages where you can start from absolute scratch, more or less, with basic key commands etc. and learning a command line text editor like VIM etc., or specific Apps investigations, back on the old main page menus:

http://www.stevepedwards.com/OldLinuxPages/Basic_Linux_Admin.html

after downloading an install .ISO from the Debian site link below.

If you want to get right into command line usage for your particular Linux flavour and general overviews, get these free books:

The Linux Cmd Line by William Shott: http://linuxcommand.org/tlcl.php Highly recommended as a quick intro to commands to paste, with explanations for all examples, from Intro to Programming concepts. Go to his site for the latest edition.

TLCL-13.07.pdf   

Linux-101-Hacks.pdf

lxes-en-manual-cc.pdf

linux-lecture-01.pdf

http://tldp.org/guides.html

https://debian-handbook.info/

OR:

apt-get install sysadmin-guide

then

vi /usr/share/doc-base/sysadmin-guide

https://packages.debian.org/sid/all/sysadmin-guide/filelist

then; e.g. paste in browser:

/usr/share/doc/sysadmin-guide/html/hw-sw-clocks.html

**********************************************************************************

If you want a full blown usable Desktop try Debian based Mint or Ubuntu, (see page bottom conclusion, and links above)

The first Posts will be basic installs and overviews of Security related stuff like AV, or recovery related repairs that are really useful to know, often for Windows systems too. First of all we need a Linux system installed, and I'm going for a resource light X Windows environment for a low spec. PC that gets a basic but broadly useful Desktop on the latest Debian Wheezy offering, that seems quite stable (but don't use kmail - it still crashes!). I'll try to keep the text colours consistent throughout.

If you ARE a beginner, just get the Gnome (default) desktop at install (I just dont like it much personally, nor the new KDE, which is too slow, bloated and flashy visual instead of functional for me, which is why I looked at LXDE - which is too sparse and basic - can't win!).

I guess that's a main reason why Linux has never won over Windows historically - the Desktops never competed well enough for most users...but now Mint and Ubuntu are here and have changed all that!

Site Text colours:

linux commands in blue

screen output in red

links in green

my/others text in black or blue italics

--------------------------------------------------------------------------------

After the base net install from:

http://cdimage.debian.org/debian-cd/7.4.0/amd64/iso-cd/debian-7.4.0-amd64-netinst.iso

with no desktop environment chosen, just apache2 server and ssh server.

X Environment

apt-get install lxde

apt-get install xorg

startx

apt-get install module-assistant build-essential chromium

Open browser, DLoad latest flash module flashplayer.so, e.g. from

get.adobe.com

and save somewhere suitable like /Downloads, then unzip the file "install_flash...tar.gz"

cd ../Downloads

gunzip install_flash...tar.gz

tar – xvf install_flash...tar

Once decompressed check for:

ls /usr/lib/chromium/plugins/

if not present, then

mkdir /usr/lib/chromium/plugins/

cp –v libflashplayer.so /etc/chromium/plugins

Visuals missing for webvids at this point...

Network Share and SSH access

If you did not select SSH server option at install, get it with:

apt-get install ssh openssh-server

then create a key pair if you want passwordless ssh transfers etc - see Notepad page:

ssh-keygen

Read the ssh man page if you have PuTTy connection issues:

man ssh_config indicates that the default order for encryption is:
aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128, aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc, aes256-cbc,arcfour

to create a Win/Lin network share:

apt-get install samba smbclient cifs-utils

smbpasswd username (old smb security)

or add a user for the PAM DB (pluggable authentication module)

pdbedit  -a  stevee

new password:
retype new password:
Unix username: stevee
NT username:
Account Flags: [U ]
User SID: S-1-5-21-3286353880-3624731801-629181994-1000
Primary Group SID: S-1-5-21-3286353880-3624731801-629181994-513
Full Name:
Home Directory: \\dell531\stevee
HomeDir Drive:
Logon Script:
Profile Path: \\dell531\stevee\profile
Domain: DELL531
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: Wed, 06 Feb 2036 15:06:39 GMT
Kickoff time: Wed, 06 Feb 2036 15:06:39 GMT
Password last set: Mon, 29 Jun 2015 23:26:51 BST
Password can change: Mon, 29 Jun 2015 23:26:51 BST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

apt-get install vim

Edit and allow these sections:

vi /etc/samba/smb.conf

security = user

[share]

path = /share (remember to create this dir before restarting samba)

browseable = 1

read only = no

writeable = 1

create mask = 0777

directory mask = 0777

NOTE - this security levels allows Everyone - Uses, Groups and Others - to write to this folder

When saved,

mkdir /share

testparm

/etc/init.d/samba restart

Check net shares on others are seen e.g.:

smbclient -L AMDA8 -U stevee
Enter stevee's password:

Domain=[AMDA8] OS=[Windows 8.1 9600] Server=[Windows 8.1 6.3]

Sharename Type Comment
--------- ---- -------
5200mfPrinterDriversXP_Vista_7 (x64) Disk
ADMIN$ Disk Remote Admin
C$ Disk Default share
D$ Disk Default share
IPC$ IPC Remote IPC
Olivetti d-Copia 5200MF KX Printer test share on Steves laptop
print$ Disk Printer Drivers
Share Disk
Domain=[AMDA8] OS=[Windows 8.1 9600] Server=[Windows 8.1 6.3]

Server Comment
--------- -------

Workgroup Master

If you have a WIFI card add these repositories to

vi /etc/apt/sources.list

deb http://http.debian.net/debian/ wheezy main contrib non-free

deb http://apt.izzysoft.de/ubuntu generic universe

apt-get update

apt-get install wireless-tools

http://wireless.kernel.org/en/users/Drivers/b43

apt-get install pcmciautils

lspci

lspcmcia

some chip makes, Broadcom b43, atheros, intel ipw3945:

apt-get install firmware-b43-installer

apt-get install firmware-atheros

apt-get install firmware-iwlwifi

lsmod | grep iwl

iwl3945 51683 0

iwl_legacy 48206 1 iwl3945

mac80211 192806 2 iwl_legacy,iwl3945

cfg80211 137243 3 mac80211,iwl_legacy,iwl3945

lsmod | grep b4

vi /etc/network/interface

wpa_passphrase {SSID : key} >> /etc/network/interfaces

------

allow-hotplug eth0

iface eth0 inet dhcp

auto wlan0

iface wlan0 inet dhcp

wpa_ssid = {SSID}

wpa_passphrase = {SSID*key hash}

Some Net/Admin Tools

apt-get install nmap tcpdump htop ntop iftop iptraf monit ksnapshot kate rsync rdesktop autoconf automake module-assistant smartmontools ntfs-3g coreutils

nmap 127.0.0.1

tcpdump –i eth0

nbtscan 192.168.1.0/24

192.168.1.12 DELL531 <server> DELL531 00:00:00:00:00:00
192.168.1.10 MINTPC100 <server> MINTPC100 00:00:00:00:00:00

htop

 

http://127.0.0.1:3000 (ntop)

ntop.png

ADD a repository to:

vi /etc/apt/sources.list

deb http://apt.izzysoft.de/ubuntu generic universe

then get:

wget http://apt.izzysoft.de/izzysoft.asc

apt-key add izzysoft.asc

apt-get update

apt-get install monitorix

The whole above process for Monitorix works in Mint 16 (Petra) also, but note there is a conf file in Mint when installed, so no need for the monitrc file additions in red below:

vi /etc/monitorix/monitorix.conf

vi /etc/monit/monitrc

set httpd port 2812 and

use address localhost # only accept connection from localhost

allow localhost # allow localhost to connect to the server and

allow admin:monit # require user 'admin' with password 'monit'

allow @monit # allow users of group 'monit' to connect (rw)

allow @users readonly # allow users of group 'users' to connect readonly

/etc/init.d/monit start

http://localhost:2812 (monit)

monit1,png

monit2.png

http://localhost:8080/monitorix

8080,png

Monitorix2.png

iPlayer vids now work – ksnapshot libs added

How to Set Terminal 8 (ctrl-alt-F8) running rsyslog to see instant changes like the /dev/sd(x) assigned to a plugged in thumbdrive etc. or just use:

tail -f /var/log/syslog

vi /etc/rsyslog.conf

#daemon,mail.*;\

news.=crit;

news.=err;

news.=notice; *.=debug;*.=info;\

*.=notice;*.=warn /dev/tty8

Music and Vid Players (plays .vob files, mp3s)

apt-get install vlc banshee

Hardware Admin; Disk Use and Status

lshw > /PC_hardware.txt

then read the file created (its too big to show here):

vi /PC_hardware.txt

df -h /

Filesystem Size Used Avail Use% Mounted on

/dev/disk/by-uuid/d3b21db0-5944-440d-ae91-fee6430e7345 7.2G 5.4G 1.5G 79% /

Total usage summary:

root@DellLinux:/home/stevee# du -sh /
du: cannot access `/proc/5687/task/5687/fd/4': No such file or directory
du: cannot access `/proc/5687/task/5687/fdinfo/4': No such file or directory
du: cannot access `/proc/5687/fd/4': No such file or directory
du: cannot access `/proc/5687/fdinfo/4': No such file or directory
75G /

sudo hddtemp /dev/sd*
/dev/sda: Hitachi HTS542516K9SA00: 31°C

sudo apt-get install smartmontools

smartctl /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-4-amd64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

ATA device successfully opened

Use 'smartctl -a' (or '-x') to print SMART (and more) information

sudo smartctl -t short /dev/sdb

Please wait 1 minutes for test to complete.

1 min later...

sudo smartctl -a /dev/sdb | grep error
was completed without error.
without error or no self-test has ever
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 39355 -

sudo smartctl -a /dev/sdb | grep PASS
SMART overall-health self-assessment test result: PASSED

smartctl -x /dev/sda | grep Power_On_Hours

9 Power_On_Hours -O--CK 075 075 000 - 18925

smartctl -x /dev/sdb | less

smartctl -x /dev/sdb | grep Celsius

smartctl -x /dev/sdb | grep Error

Smartgrep.jpg

root@DellLinux:/home/stevee# fdisk -l

Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000646d3

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 20508671 10253312 7 HPFS/NTFS/exFAT
/dev/sda2 20508672 250066943 114779136 7 HPFS/NTFS/exFAT

Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x186754fa

Device Boot Start End Blocks Id System
/dev/sdb1 615374928 625142447 4883760 82 Linux swap / Solaris
/dev/sdb2 * 63 615374927 307687432+ 83 Linux

Partition table entries are not in disk order

Disk /dev/sdc: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000952cb

Device Boot Start End Blocks Id System
/dev/sdc1 * 2048 482115583 241056768 83 Linux
/dev/sdc2 482117630 488396799 3139585 5 Extended
/dev/sdc5 482117632 488396799 3139584 82 Linux swap / Solaris

root@DellLinux:/home/stevee# blockdev --report
RO RA SSZ BSZ StartSec Size Device
rw 256 512 4096 0 128035676160 /dev/sda
rw 256 512 4096 2048 10499391488 /dev/sda1
rw 256 512 4096 20508672 117533835264 /dev/sda2
rw 256 512 4096 0 320072933376 /dev/sdb
rw 256 512 4096 615374928 5000970240 /dev/sdb1
rw 256 512 512 63 315071930880 /dev/sdb2
rw 256 512 4096 0 250059350016 /dev/sdc
rw 256 512 4096 2048 246842130432 /dev/sdc1
rw 256 512 1024 482117630 1024 /dev/sdc2
rw 256 512 4096 482117632 3214934016 /dev/sdc5

lsblk -o name,label,size,fstype,model

NAME LABEL SIZE FSTYPE MODEL
sda 931.5G d2 quadra
\u2514\u2500sda1 Quadra 931.5G ntfs
sdf 298.1G WDC WD3200AAKS-7
\u251c\u2500sdf1 294.1G ext4
\u251c\u2500sdf2 1K
\u2514\u2500sdf5 4G swap

root@DellLinux:/home/stevee# ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Apr 17 15:49 102411fe-e875-4d38-a8fc-bd90878babfb -> ../../sdc5
lrwxrwxrwx 1 root root 10 Apr 17 15:49 3499b9e1-f692-447e-89bf-92407f676c61 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Apr 17 15:49 6A0C22440C220B9F -> ../../sda2
lrwxrwxrwx 1 root root 10 Apr 17 15:49 7FE036E864771F77 -> ../../sda1
lrwxrwxrwx 1 root root 10 Apr 17 15:49 a393dc50-c1fa-4b6f-a4f9-10f0ee407918 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Apr 17 15:49 f96c17ba-4257-4f74-8a07-d70fb03e0172 -> ../../sdb1

ls -l /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 10 Jun 30 18:08 Quadra -> ../../sda1

ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 9 Jun 30 18:08 ata-ST31000528AS_6VPBCAY0 -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 30 18:08 ata-ST31000528AS_6VPBCAY0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Jun 30 18:12 ata-TOSHIBA_MK2552GSX_586LF3H0S -> ../../sdg
lrwxrwxrwx 1 root root 10 Jun 30 18:12 ata-TOSHIBA_MK2552GSX_586LF3H0S-part1 -> ../../sdg1
lrwxrwxrwx 1 root root 10 Jun 30 18:12 ata-TOSHIBA_MK2552GSX_586LF3H0S-part2 -> ../../sdg2
lrwxrwxrwx 1 root root 9 Jun 30 18:08 ata-WDC_WD3200AAKS-75VYA0_WD-WCARW4221557 -> ../../sdb
lrwxrwxrwx 1 root root 10 Jun 30 18:08 ata-WDC_WD3200AAKS-75VYA0_WD-WCARW4221557-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 30 18:08 ata-WDC_WD3200AAKS-75VYA0_WD-WCARW4221557-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jun 30 18:08 ata-WDC_WD3200AAKS-75VYA0_WD-WCARW4221557-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 9 Jun 30 18:08 usb-TEAC_USB_HS-CF_Card_000006036157-0:0 -> ../../sdc
lrwxrwxrwx 1 root root 9 Jun 30 18:08 usb-TEAC_USB_HS-MS_Card_000006036157-0:2 -> ../../sde
lrwxrwxrwx 1 root root 9 Jun 30 18:08 usb-TEAC_USB_HS-SD_Card_000006036157-0:3 -> ../../sdf
lrwxrwxrwx 1 root root 9 Jun 30 18:08 usb-TEAC_USB_HS-xD_SM_000006036157-0:1 -> ../../sdd
lrwxrwxrwx 1 root root 9 Jun 30 18:12 wwn-0x5000039106002279 -> ../../sdg
lrwxrwxrwx 1 root root 10 Jun 30 18:12 wwn-0x5000039106002279-part1 -> ../../sdg1
lrwxrwxrwx 1 root root 10 Jun 30 18:12 wwn-0x5000039106002279-part2 -> ../../sdg2
lrwxrwxrwx 1 root root 9 Jun 30 18:08 wwn-0x5000c50032a5b064 -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 30 18:08 wwn-0x5000c50032a5b064-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Jun 30 18:08 wwn-0x50014ee1ab6a23b1 -> ../../sdb
lrwxrwxrwx 1 root root 10 Jun 30 18:08 wwn-0x50014ee1ab6a23b1-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 30 18:08 wwn-0x50014ee1ab6a23b1-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jun 30 18:08 wwn-0x50014ee1ab6a23b1-part5 -> ../../sdb5

$ mount
/dev/sdb5 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=stevee)
//Acer1/e on /Acer1 type cifs (rw)

Office

apt-get install openoffice.org

If you want a good mail client with functionality:

apt-get install evolution

--------------------------------------------------------------------------------------------

Conclusion 18/4/14

I have to say, that Debian with any Desktop has not really improved over the last 5 years from KDE4 onwards, in my opinion, and there are far nicer and more functional Distros available like Ubuntu and Mint with Cinnamon, and no doubt others too.

I finally got sick of LXDE and KDE - just hassle - so installed Cinammon last night and so far I am REALLY impressed - the simplest Linux install with the nicest design I have experienced yet. The Thunderbird mail setup was done in seconds using a Mozilla provider database for settings just from your email address - slick!

It looks great too. The DL is very large at 1.2GB for the .iso, but you get what you (don't!) pay for I guess...a Desktop users equivalent to W7? We'll see...

http://linuxmint.com/

DT.png

++++++++++++++++++++++++++++++++++PAGE STATS+++++++++++++++++++++++++++

Statistics recorded with Counterize - Version 3.1.4

  Today Last 24 hours Last 7 days Last 30 days Total
Hits16452101777304993
Pages views142141923205738
Unique visitors153311067255445
Unique visitors ‪(1h interval)‬15371601323155456
Unique visitors ‪(30 min interval)‬15371651366164584
Hits per unique visitor1.071.361.912.645.5
Pages per unique visitor0.930.640.371.373.71

Most visiting countries ‪(10)‬

CountriesAmountPercentage
National flag of United States United States 112488   41.53 %
Unknown 40074   14.79 %
National flag of Russian Federation Russian Federation 37086   13.69 %
National flag of China China 18917   6.98 %
National flag of European Union European Union 17291   6.38 %
National flag of France France 15540   5.74 %
National flag of Ukraine Ukraine 11675   4.31 %
National flag of United Kingdom United Kingdom 8025   2.96 %
National flag of Germany Germany 6903   2.55 %
National flag of Czech Republic Czech Republic 2887   1.07 %