User Tools

Site Tools


debian

Avoid filesystem fsck after x startups

change

/dev/sda1  ext3  errors=remount-ro  0  1

to

/dev/sda1  ext3  errors=remount-ro  0  0

Mount read-only filesystem as rw

case: launched debian but with system as read-only (after cancelling the forced fsck)

mount -o remount,rw /

Mount remote Samba share

mount -t cifs -o username=YourUsername,password=YourPassword //ip.address/dir /local/dir

Allow permanent routing

until reboot:

sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'

persistent:
add to /etc/sysctl.conf:

net.ipv4.ip_forward = 1

Logs have different timestamp

Point in case: OpenVPN's log file was off by 2 hours (showing GMT, instead of CEST)
This is because of the chroot to /etc/openvpn/jail
To correct this problem, do the following:

sudo cp /etc/localtime /etc/openvpn/jail/etc/localtime

New hard drive

Set HDD label

tune2fs -L label /dev/sdb1

Change % of HDD allocated to root

sudo tune2fs -m 2 /dev/sdb1

Remove package and associated files

apt-get remove --purge package
apt-get clean

CHMOD only files or folders

find /path/to/base/dir -type d -exec chmod 755 {} +
find /path/to/base/dir -type f -exec chmod 644 {} +
chmod 755 $(find /path/to/base/dir -type d)
chmod 644 $(find /path/to/base/dir -type f)
find /path/to/base/dir -type d -print0 | xargs -0 chmod 755
find /path/to/base/dir -type f -print0 | xargs -0 chmod 644
 
chmod -R u+rwX,go+rX,go-w /path

SSH asks for password even with keys configured / SSH won't use keys

Check that the .ssh folder doesn't have write permissions for anyone else than the user

chmod go-w .ssh
debian.txt · Last modified: 2014/09/07 18:31 by johanndickson