Archive for the 'linux' Category
Edit Sudoers File - visudo
Monday, May 5th, 20081) Open the sudoers file safely:
visudo command edits the sudoers file in a safe fashion.
Attention: you can only run visudo as root
This is a vi editor. Here are some basic vi commands:
To enter vi insert mode: i
To enter vi command mode: [esc]
To exit vi and save changes: ZZ or :wq
To exit vi […]
How to restart SSH (restarting SSHD) remotely?
Saturday, March 1st, 2008There are a few different ways to restart SSHD remotely.
You will need root access in order to do this.
1) /etc/init.d/sshd restart
2) kill `cat /var/run/sshd.pid` && /usr/sbin/sshd
How to disable root login in Linux
Saturday, March 1st, 2008It is a good idea to disable root login for security purposes and use your login name and use sudo to get root privileges.
First of all, make sure you have your own login name and you can get root privileges by using sudo.
So, open up /etc/ssh/sshd_config and comment out
AllowUsers root
so it will look like:
#AllowUsers admin
You […]
Linux shell restricting access
Wednesday, November 14th, 2007See which files has a process open
Tuesday, November 13th, 2007Command: lsof -p processID
Example: lsof -p 4048
More info, source: http://forum.ensim.com/showthread.php?t=18798
How to calculate directory size on linux
Wednesday, September 26th, 2007du -sxch home/* for subfolders of home
more:
http://community.livejournal.com/linux/1685214.html
How to add user (useradd, adduser) Linux
Wednesday, August 29th, 2007/usr/sbin/useradd -g groupname username
more info here
Downlad a file via http in Linux
Sunday, March 4th, 2007wget
Example: wget http://wilmer.gaast.net/downloads/axel-1.0b.tar.gz
recursive chown command in Linux
Sunday, March 4th, 2007cd /usr/tom
chown -R tom:group *