Category: Linux

Linux Services | View All | Stopping and Starting

How To see all services available, type in terminal; sudo service –status-all How To see all services running and ports, type in terminal; sudo netstat -plunt How To remove a service from startup at boot sudo update-rc.d -f [service] remove How To enable a service to run on boot sudo update-rc.d [service] defaults

How to Change or Disable SSH Timeout

On Client sudo vi /etc/ssh/ssh_config add line ServerAliveInterval 100 On Server sudo vi /etc/ssh/sshd_config add lines ClientAliveInterval 30 TCPKeepAlive yes ClientAliveCountMax 99999 From command line per session ssh -o ConnectTimeout=10 ssh -o ConnectTimeout -o BatchMode=yes -o StrictHostKeyChecking=no ServerAliveInterval operates on the ssh layer. It will actually send data through ssh, so the TCP packet has encrypted data in and a...

vi cheat sheet

Command of the day :.,$s/find-this-string/replace-with-this-string/g     Quitting :x Exit, saving changes :wq Exit, saving changes :q Exit as long as there have been no changes ZZ Exit and save changes if any have been made :q! Exit and ignore any changes Motion h Move left j Move down k Move up l Move right w Move to next word...

Could not chdir to home directory home Permission denied

This one has caught me a couple times and I keep forgetting how simple it is to solve. When you create a new user and then login as the new user, you get this message: Could not chdir to home directory /home/user: Permission denied -bash: /home/user .bash_profile: Permission denied And you find that you are not (and not able to...

Debian Environment Variables

And then I lived happily ever after – Fixed – BASH scripts executed from a user as sudo, resulted in the root ownership. In other words, a backup script executed by user became the property of root

How To Harden Debian Server

Its not enough to harden just Debain. Its necessary to harden the rest of Apache-MySQL-PHP as well. Harden MYSQL sudo mysql_secure_installation answer Yes to all questions (but no need to change password) Disabling SSH root login and settings sudo vi /etc/ssh/sshd_config change PermitRootLogin yes to PermitRootLogin no LoginGraceTime 120 to LoginGraceTime 30 add line AllowUsers username username username Consider disabling...

Netfilter iptables Log Message Codes

IN = Input interface OUT = Output interface MAC = Ethernet hardware address (aka MAC address) SRC = Source IP address DST = Destination IP address LEN = Packet length TOS = Type of Service (for packet prioritization) PREC = Precedent bits TTL = Time to Live ID = Packet identifier PROTO = Protocol (eg. TCP, UDP) SPT = Source...

-bash: sudo: command not found

When you see this error message -bash: sudo: command not found su apt-get install sudo adduser username sudo apt-get install locales locale-gen en_US.UTF-8

Customize Debian Linux grub2

I wanted to remove the splash image while booting Debian 7 Wheezy and watch the code execute, while also use the full screen resolution.

Debian 7 Restart Network

Im using Debian Wheezy (7) desktop with DHCP. I had problems switching from wired to wireless and back, etc. I found that following other instructions did not work. The network will go down no problem;