Monthly Archives: May 2014

My new server bandwidth graphs

 

Graph daily bandwidth – That boost was after pointing a single subdomain to the new server.
Graph weekly bandwidth – On Wednesday I’v switched some domains and subdomains to the server.
Graph monthly bandwidth – first weeks were just to move content from the old server.

Linux disks structure and information

This is a result on a dedicated server.

Disk structure
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

NAME FSTYPE SIZE MOUNTPOINT LABEL sda 465.8G |-sda1 ext4 190M /boot |-sda2 ext4 464.6G / `-sda3 swap 976M [SWAP]

Disk details
sudo hdparm -I /dev/sda

 

/dev/sda:

ATA device, with non-removable media
Model Number: TOSHIBA MQ01ABF050H
Serial Number: 14IFC0D3T
Firmware Revision: ARF02A
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
Supported: 8 7 6 5
Likely used: 8
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors: 976773168
Logical Sector size: 512 bytes
Physical Sector size: 4096 bytes
Logical Sector-0 offset: 0 bytes
device size with M = 1024*1024: 476940 MBytes
device size with M = 1000*1000: 500107 MBytes (500 GB)
cache/buffer size = unknown
Form Factor: 2.5 inch
Nominal Media Rotation Rate: 5400
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Advanced power management level: 254
DMA: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* Host Protected Area feature set
* WRITE_BUFFER command
* READ_BUFFER command
* NOP cmd
* DOWNLOAD_MICROCODE
* Advanced Power Management feature set
Power-Up In Standby feature set
SET_MAX security extension
* 48-bit Address feature set
* Device Configuration Overlay feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
* IDLE_IMMEDIATE with UNLOAD
* WRITE_UNCORRECTABLE_EXT command
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Gen3 signaling speed (6.0Gb/s)
* Native Command Queueing (NCQ)
* Host-initiated interface power management
* Phy event counters
* Idle-Unload when NCQ is active
* Host automatic Partial to Slumber transitions
* Device automatic Partial to Slumber transitions
* READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
DMA Setup Auto-Activate optimization
Device-initiated interface power management
* Software settings preservation
* SMART Command Transport (SCT) feature set
* SCT Write Same (AC2)
* SCT Error Recovery Control (AC3)
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
Security:
Master password revision code = 65534
supported
not enabled
not locked
frozen
not expired: security count
supported: enhanced erase
114min for SECURITY ERASE UNIT. 114min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000039543a063f1
NAA : 5
IEEE OUI : 000039
Unique ID : 543a063f1
Checksum: correct

Read more at http://askubuntu.com/questions/182446/how-do-i-view-all-available-hdds-partitions http://www.cyberciti.biz/faq/find-hard-disk-hardware-specs-on-linux/

SFTP – Restrain/Lock/Jail the user to their home

Create the user and their home
cd /home
mkdir username
useradd -d /home/username -M -N -g users username
sudo chown root:root /home/username
sudo chmod 755 /home/username
Edit /etc/ssh/sshd_config
nano /etc/ssh/sshd_config

Search for “lib/openssh/sftp-server” and make it like

#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp

Add the following lines bellow it…

Match User username
    ChrootDirectory /home/username
    ForceCommand internal-sftp
Restart SSH
service ssh restart

More readings
http://www.techrepublic.com/blog/linux-and-open-source/chroot-users-with-openssh-an-easier-way-to-confine-users-to-their-home-directories/
http://superuser.com/questions/370953/how-to-not-allow-user-outside-of-home-directory-with-sftp