Categories
Uncategorized

SSH: Login without a password

1.- On client computer, create private/public keys: Accept all defaults

ssh-keygen -t rsa

2.- copy public key to remote host

ssh-copy-id -i ~/.ssh/id_rsa.pub  remotehost

3. test

ssh remotehost

4.- Disable Password login, edit /etc/ssh_config

Find PasswordAuthentication

Change it from #PasswordAuthentication yes to PasswordAuthentication no

5.- Restart sshd

systemctl restart sshd
Categories
Uncategorized

Configuring a NIS client and mounting home directories from an NFS server

First Configure NIS

  1. Edit /etc/passwd and add the following at the end of the file
+::::::

2. Edit /etc/group and add the following at the end of the file

+:::

3. Edit /etc/shadow and add the following at the end of the file

+::::::::

4.  Edit /etc/yp.conf

ypserver 192.168.1.10

ypserver 192.168.1.11

5.- Reboot or restart NIS /etc/init.d/nis restart

 

Now, mount the home dirs using NFS

  1. Edit /etc/auto.master
  2. /home /etc/auto.home --timeout=60

2.  create a new file in /etc/home.auto and add the following

* -fstype=nfs,rw,nosuid,soft,fsid=0 hostname:/mnt/Volume1/home/&

To find the hostname and the mount point for the NFS server, from a pre-configure client run df -kh

 

Categories
Uncategorized

Deleting temp files in all profiles

REM @echo off
set HDRIVE=C:
set HPATH=\Documents and Settings\
%HDRIVE%
cd %HPATH%
REM – This line sets up the loop for the script
for /d %%i in (*) do call :ifthen %%i
goto end
REM – Remove Temp and Temporary Internet Files folder.
:ifthen
del /f/s/q “%HDRIVE%%HPATH%%1\Local Settings\temp
del /f/s/q “%HDRIVE%%HPATH%%1\Local Settings\Temporary Internet Files
del /f/s/q “%HDRIVE%%HPATH%%1\Local Settings\History
del /f/s/q “%HDRIVE%%HPATH%%1\Cookies
del /f/s/q “%HDRIVE%%HPATH%%1\Desktop\Word*.*
del /f/s/q “%HDRIVE%%HPATH%%1\Desktop\outlook*.*
del /f/s/q “%HDRIVE%%HPATH%%1\Desktop\Power*.*
del /f/s/q “%HDRIVE%%HPATH%%1\Desktop\Excel*.*
del /f/s/q “%HDRIVE%%HPATH%%1\Desktop\Access*.*
del /f/s/q “%HDRIVE%%HPATH%%1\Desktop\Common\micro*.*

goto :EOF
:end

Categories
Uncategorized

Backing up Windows XP files using rsync and Deltacopy

My backup is based on this article,

http://justinsomnia.org/2007/02/how-to-regularly-backup-windows-xp-to-ubuntu-using-rsync/

Rsync on Windows XP did not work as outlined in that article, so I installed Deltacopy and setup rsync on ubuntu.

First step install rsync on Ubuntu, I am using Ubuntu 10.10.
1) Install rsync, sudo apt-get install rsync

2) Edit the rsync fonfiguration,
sudo nano /etc/rsyncd.conf

3a) Add the following. Note, when you run deltacopy client on Windows what’s on brackets will be your Virtual Directory Window.
Replace username by your Ubuntu username.

       [weeklybackup]
           path = /home/username/backup
           comment = Backup
           uid = username
           gid = username
           read only = false
           auth users = username
           secrets file = /etc/rsyncd.secrets

3b) Very important: create the “backup” directory otherwise deltacopy will give you error messages, something about error 5.
mkdir backup

4) sudo chmod 644 /etc/rsyncd.conf

5) Create the secrets file
sudo nano /etc/rsyncd.secrets
and enter your ubuntu username and password in the form of username:password. Save the file (ctl-x) and exit, don’t add anything else except your username:password

5a) Back in the terminal window type,
sudo chmod 600 /etc/rsyncd.secrets

6) Change RSYNC_ENABLE=false to true by editing the /etc/default/rsync
sudo nano /etc/default/rsync

7) Now Reboot or restart rsync, to restart rsync type
sudo /etc/init.d/rsync restart


Now setup Deltacopy on your Windows computer. I am using Windows XP

8 ) Install DeltaCopy
Download and Install DeltaCopy.

http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp

After the installation DeltaCopy server console will come up. Skip it. Go back to the Start menu and open DeltaCopy client.

Create a new profile as shown in the DeltaCopy site. My profile setup is as follows.

As shown I used an IP address instead of the hostname and I am using weeklybackup as my virtual directory.  weeklybackup is what I specified in step 3 above.

Click Add Profile to go back to the main menu.

Now add the folders  that you want to backup.

You can also schedule a backup. Note: if you schedule a backup you need to have a password on your Windows computer.

At first my backup was not working, if that’s the case enter your ubuntu username/password in the authentication tab.

Mine looks like the following.

That’s it you should now have a working automated backup.