This command will show you when a user's password was last changed, for example for user root:
# chage -l root
Even though Ubuntu is very complete initially, you might want extra's, like a media player. You can use a script to do this for you:
# wget http://download.ubuntuforums.org/ubuntusetup/ubuntusetup.sh
# sudo sh ubuntusetup.sh
A very easy command to find all empty directories on a system:
# find dir -empty -type d -depth -printThe "-empty" parameter doesn't work on AIX.
Topics: Installation, Red Hat / Linux↑
Yum
Use yum to update your system (for Fedora or Red Hat):
# yum updatewill update all the packages on your system. If you need to configure a proxy server for yum to use, then just add the following line to /etc/yum.conf:
proxy=http://address-of-proxyserver.org:80Of course set it to your correct proxy server and port number.
If you want to make sure SSH is auto-started at system reboot on Red Hat:
# chkconfig --list sshdIf you don't see the word "on" under the 3 and 5 columns then:
# chkconfig sshd on
# service sshd start
This is a description on how to install a VNC server on a Linux system, and how to access it from a Windows desktop.
First run on the Linux server:
# yum install vnc-server twm xtermEdit file /etc/sysconfig/vncservers, and add:
For your situation, make sure you enter valid user accounts for each user that you want to allow a VNC connection. In the example above, these are users user1, user2, user3 and user4. Also make sure that you create a VNCSERVERARGS entry for each user.VNCSERVERS="1:user1 2:user2 3:user3 4:user4 " VNCSERVERARGS[1]="-geometry 1024x768" VNCSERVERARGS[2]="-geometry 1024x768" VNCSERVERARGS[3]="-geometry 1024x768" VNCSERVERARGS[4]="-geometry 1024x768"
Create the users (if they don't exist already):
Repeat for the other users.# useradd user1 # passwd user1 # su - user1 # vncpasswd
Add ports 5901, 5902, 5903 and 5904 to the firewall (tcp). This step depends on your Linux system.
Edit /home/user1/.vnc/xstartup:
Copy this xstartup file to the home directory of the other users.#!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & twm &
Restart the vncserver:
# service vncserver restartDownload & install TightVNC on your Windows desktop; you only need to install the Viewer.
http://www.tightvnc.com/download.html
Run TightVNC Viewer, and enter hostname:x (where "x" is the number of your display as defined in the vncservers file above, and where hostname is the hostname of the Linux server) as the VNC server, and click on Connect. Enter the corresponding password as set by the vncpasswd command and you should get a VNC window on your host.
Install the software:
# yum -y install mysql mysql-server php-mysql httpd php phpmyadminCreate link from the DirectoryRoot of the webserver to PhpMyAdmin:
# cd /var/www/htmlMake sure the services are started at boot time:
# ln -s /usr/share/phpMyAdmin
# chkconfig httpd onSet the root password for mysql:
# chkconfig --add mysqld
# chkconfig mysqld on
# service httpd start
# service mysqld start
# mysqladmin -u root password rootMake additional security-related changes to mysql:
# mysql -u root -pFollowing the above steps, the document root for Apache is /var/www/html/. Create a test PHP script (such as phpinfo.php) and place it in the document root. A useful test script sample:
mysql> DROP DATABASE test; [removes the test database]
mysql> DELETE FROM mysql.user WHERE user = ''; [Removes anonymous access]
<?phpTest with a brower: http://hostname/phpinfo.php
phpinfo();
?>
Create a database:
mysql> create database testdbAdd the following to /etc/httpd/conf/httpd.conf:
<Directory "/usr/share/phpMyAdmin">Set the ServerName entry to hostname:80
Order allow,deny
Allow from all
</Directory>
Add "index.php" to the DirectoryIndex entry, so the webserver also recognizes index.php as an index file.
Restart the http server:
# service httpd restartTest with a browser: http://hostname/phpMyAdmin/
Run to install:
# yum install pure-ftpdHave it start at system reboot:
# chkconfig pure-ftpd onStart it:
# /etc/init.d/pure-ftpd startEnable UnixAuthentication in /etc/pure-ftpd/pure-ftpd.conf.
Restart the FTP server:
# /etc/init.d/pure-ftpd restart
Topics: Installation, Red Hat / Linux↑
APT
APT is short for Advanced Packaging Tool and is found in Debian distributions of Linux, like Ubuntu. To be able to use APT, you first need to download a list of available software:
# sudo apt-get updateTo download the webbrowser Firefox, type:
# sudo apt-get install mozilla-firefoxWith the command
# sudo apt-cache search [search-term]you can search for a specific program.
To upgrade your complete system:
# sudo apt-get upgradeBesides the command-line, you can also use the graphical user interface Synaptic.
If you have any VMWare images, where you made the disk size a little too small, then fortunately in VMWare Workstation you can change the size of a disk with a simple command line program. Sadly the command only makes your drive bigger not the actual partition. And especially Windows won't allow you to resize the partition where the Windows binaries are installed. So how can you get around that?
First, create a copy of your vmdk file to somewhere else, should the next action fail for some reason.
Then resize the disk to the required size:
# vmware-vdiskmanager -x 8GB myDisk.vmdkYou need to have plenty of disk space free to do this operation, as your vmdk file will be copied by vmware-vdiskmanager. BTW, this command may take a while, depending on the size of your vmdk file.
Now get the ISO image of System Rescue CD-ROM and set the VMWare session to boot of the ISO image. Then, run QTParted. You can do this by starting this CD-ROM with a framebuffer (press F2 at start) and then run run_qtparted as soon as Linux has started. Select the windows drive partition with the right mouse button and choose resize. Set the new size and commit the change. Then exit from QTParted and from Linux (init 0). Remove the ISO image from the VMWare session and restart VMWare to normally start Windows. Windows will detect the disk change and force a chk_disk to run. Once Windows has started, the new disk size is present.


