Change the default root password using
# passwd
.Copy
firewall
shell script and modify it accordingly. Run it.Setup SSH by editing
/etc/ssh/sshd_config
and adding/editing the following lines. Note each allowed SSH user must replace USERNAME1, USERNAME2, etc. below.Port SSH_PORT PermitRootLogin no UseDNS no AllowUsers USERNAME1 USERNAME2
Now restart the SSH service:
# systemctl restart sshd.service
and note any change in SSH ports for when you reconnect.Add desired users using
# adduser USERNAME
and set a default password# passwd USERNAME
.Remove the default "Fedora cloud user" account using
# userdel fedora -r
.Allow users
sudo
permission by running# visudo
and adding aUSERNAME ALL=(ALL) ALL
entry for each allowed USERNAME.Update the system:
# yum update
and# yum upgrade
.Install some important packages:
# yum group install "Development Tools"
,# yum install libxslt-devel libxml2-devel
..
Create a key:
$ cd ~/.ssh $ ssh-keygen -t rsa -f USERNAME_rsa $ chmod 700 ~/.ssh $ chmod 600 ~/.ssh/USERNAME_rsa
Copy the public key to the server, eg.
$ scp -P 7331 ~/.ssh/USERNAME_rsa.pub USERNAME@SERVER_ADDRESS:/home/USERNAME/
.Ensure the correct SELinux contexts are set:
$ restorecon -Rv ~/.ssh
.
Append the public key to the profile's
authorized_keys
SSH file and set file permissions:$ cat USERNAME_rsa.pub >> ~/.ssh/authorized_keys $ chmod 700 ~/.ssh $ chmod 600 ~/.ssh/authorized_keys
Ensure the correct SELinux contexts are set:
$ restorecon -Rv ~/.ssh
.
- Open
/etc/sysconfig/network
file and modify theHOSTNAME=
value to match your FQDN host name:$ sudo vi /etc/sysconfig/network
. - Open
/etc/hosts
file and modify any line referencing the old HOSTNAME to point to the new HOSTNAME. - Run the
hostname
command to see the current/old HOSTNAME and then run again with the first argument to set the new HOSTNAME:$ sudo hostname
and$ sudo hostname NEW_HOSTNAME
. - Restart the networking service:
$ sudo /etc/init.d/network restart
.
- Install httpd:
# yum install httpd httpd-itk mod_wsgi mod_ssl openssl
. - Start the service:
# systemctl start httpd.service
. - Check the status:
# systemctl status httpd.service -l
. - Open a web browser and point it to server's IP address.
- Enable automatic start of httpd at boot:
# systemctl enable httpd.service
. - Copy
vhosts.conf
httpd config file to /etc/httpd/conf.d/ and restart httpd:# systemctl restart httpd.service
.
- Find the device by its mount point:
# fstab -l
. - Get the devices associated UUID:
$ ls -l /dev/disk/by-uuid
(this will allow you to plugin the device into any other port on the computer). - Create the mount directory:
# mkdir /mnt/rb1tb
. - Edit the fstab file:
# vi /etc/fstab
. - Add the following line to the file:
UUID=43d65df3-ad4e-447e-ac97-a992c1dbe427 /mnt/rb1tb ext4 defaults 1 1
.
- Install easy_install:
# yum install python-setuptools
. - Install pip:
# easy_install pip
.
- Set your script to be executable:
$ chmod 755 script.py
. - Create a symbolic link to the file in cron:
$ ln -s /PATH/TO/script.py /etc/cron.hourly/
.
NOTE 1: If you are using the steps below for your client computer with Fedora/CentOS/RHEL, it is recommended to replace the references to /usr/local/bin
with $HOME/bin
. Note also that if you do this, you do not need to run the associated command with sudo
.
NOTE 2: If installing on a client computer with Fedora/CentOS/RHEL: skip step 5 and make sure $HOME/bin
is in your PATH environment variable. If it isn't add export PATH=$PATH:$HOME/bin
to ~/.bashrc
and run $ source ~/.bashrc
.
- Install dependencies via YUM:
$ sudo yum install haskell-platform gnutls-devel libgsasl-devel libxml2-devel zlib-devel ghc-zlib-devel libidn-devel
. - Update cabal:
$ cabal update
. - If needed, upgrade cabal:
$ cabal install cabal-install
. - Install c2hs:
$ sudo cabal install c2hs --bindir=/usr/local/bin/
. - Create symbolic link for
c2hs
within/usr/sbin
so you can run it as sudo or root:$ sudo ln -s /usr/local/bin/c2hs /usr/sbin/
. - Finally, install git-annex:
$ sudo cabal install git-annex --bindir=/usr/local/bin/
. - If you encounter any errors with the installation, with regards to the Glasgow Haskell Compiler (ghc) see below.
You will have to compile the newest version by going to the website http://justhub.org/download (as recommended on http://www.haskell.org/platform/linux.html).
- Download the rpm for CentOS 6:
$ wget http://sherkin.justhub.org/el6/RPMS/x86_64/justhub-release-2.0-4.0.el6.x86_64.rpm
. - Add the rpm to Yum:
$ sudo -ivh justhub-release-2.0-4.0.el6.x86_64.rpm
. - Now install Haskell:
$ sudo yum install haskell
. - You might have received an error about the existing compiler, remove it using:
$ sudo yum remove [package(s)]
.
Users can be allowed to create cron jobs when their username is specified using the following:
Move or delete the
.deny
file:$ sudo mv /etc/cron.deny /etc/cron.deny.NOT_USED
Add usernames (one per line) to the
.allow
file to give users access to create cron jobs:$ sudo vi /etc/cron.allow (add username, save, and exit the file)
Specified users can now use the
$ crontab -e
command to specify their own cron jobs.
To allow users to run scripts when the server boots up, follow these steps:
Give each user an executable
boot.sh
shell file in their home directory. The user can edit this file to add commands to be ran when the system boots.Open
/etc/rc.local
and add the following line for each user that has aboot.sh
file. ReplaceUSERNAME
with their username.(su -c /home/USERNAME/boot.sh USERNAME) &
The next time the server restarts each of the specified
boot.sh
scripts inrc.local
will be run as the respective user.