restarting/stopping/starting a service On any init.d based linux distro you can restart a service with the following… /etc/init.d/serviceName restart You may replace ‘restart’ with ’stop’ or ’start’ (and in some cases ’status’). Forcefully stopping a service killall processName Killing on instance of a service kill pid The pid can be gathered by either top or… Continue reading Service/Daemon Management
Month: July 2011
User Management
useradd useradd userName then run “passwd userName” to set the new users pw passwd passwd username will ask for the new pw twice
File Permissions
Listing Permissions ls -al will display all files in a list with their owners and permissions -rw-r–r– 1 irq13 irq13 1006 Jan 24 10:16 .bashrc Now to break down the above example… -rw-r–r– is the permissions area. The first – would be d if the item is directory, otherwise it will be -. The second… Continue reading File Permissions
Additional command operators
ps | grep ssh — only display lines that contain ssh ; used to “stack commands” or issue multiple commands on 1 line. cd ..; ls & puts a command in the background. Will let you know when the command is finished > write what is displayed on the screen from a given command to… Continue reading Additional command operators
Basic commands
* whoami : displays current user * top : displays the top cpu/memory eaters and system load.. like task manager on windows * ps : displays all processes running.. ps aux is the most useful way to run it * wall “some text” : sends a broadcast message to all logged on users * man… Continue reading Basic commands
File System
/ : root of the file system contains all devices and directory’s /root : the root users home directory /home : all other users home dirs reside in here /boot : All the kernels and boot specific info /tmp : temporary files are stored here, is commonly world writable so keep an eye on it… Continue reading File System
Basics
I see most of the people searching for basics on linux and found much difficult to get it in short. I have gathered some from a wiki and will add to this section. This might help some of you guys 🙂
How to Disable Telnet access on server
Telnet should be disabled on all web servers, and you should use SSH which is more secure. Telnet sends password in plain text passwords and usernames through logins, and ‘crackers/hackers’ can obtain these passwords easily as compared to SSH. TELNET server listens for incoming messages on port 23, and sends outgoing messages to port 23.… Continue reading How to Disable Telnet access on server
Cannot install binary packages using pkg_addCannot install binary packages using pkg_add
Failure to install binary packages in older FreeBSD versions using “pkg_add -r”. Solution: Add these lines to /etc/csh.cshrc (/etc/profile if you are using bash or sh): [FreeBSD 4.x] setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-4-stable/Latest/ setenv PACKAGELIST [FreeBSD 5.x] setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/Latest/ setenv PACKAGELIST
Installing qmHandle
qmHandle is a simple program which allows you to view and manage the qmail queue. Installation: wget http://jaist.dl.sourceforge.net/sourceforge/qmhandle/qmhandle-1.3.2.tar.gz tar xvzf qmhandle-1.2.0.tar.gz chmod 777 qmHandle ./qmHandle –h That will show you how to use ./qmHandle Now, i am writing few tips how to use it. /root/qmHandle/ -s Messages in local queue: 0 Messages in remote queue:… Continue reading Installing qmHandle