Showing posts with label SSH. Show all posts
Showing posts with label SSH. Show all posts

Thursday, November 19, 2009

Setting up a sFTP server on Windows for DRS

My environment: UC Manager 7.0.1.11000-3

For security reason, DRS only allows to transfer backup files to sFTP server if you don’t want to backup to tape.  Here is a simple tutorial on how to setup a sFTP server on Windows.

1. Get the OpenSSH windows package here.  Install it.

2. Open a command prompt, go to the installation directory.  e.g. c:\program files\openssh

3. Create group file in command prompt

mkgroup –l >> ..\etc\group

4. Add user to passwd file.  The users need to be an existing Windows user.  Say for example the username is panda.

mkpasswd –l –u panda >> ..\etc\passwd

5. You can change the home folder in passwd file.  Otherwise your home folder will be the OpenSSH installation folder.

6. Start the OpenSSH service.

7. Very important reminder is, make sure you have write permission to your home folder, otherwise DRS can’t write to it!

Tuesday, April 28, 2009

Network backup with Rsync

My environment: RH FC8 x86_64
Rsync Version: rsync-2.6.9-3.2.fc8

 

1. Enable rsync server in xinetd:

vi /etc/xinetd.d/rsync

disable = no

2. Start xinetd on server side

3. Generate password-less inter-host key for SSH connection between rsync server and client.  Follow the tutorial here.

4. Run this on rsync server:

rsync -ave ssh --numeric-ids rsync-client-hostname:/files-to-be-backup /backup-location-on-server

Saturday, February 16, 2008

Generate host key for inter-host SSH

You will find it handy to let the hosts communication each other and transfer files using SSH or SCP, but you don't want to allow Password Authentication to prevent password brute force attacks. You can generate the key pairs and allow key authentication with the following steps:

1. Make sure OpenSSH is installed
2. Check if you have directory $HOME/.ssh
3. ssh-keygen -t rsa, then it will generate the public (id_rsa.pub) and private (id_rsa) key files in $HOME/.ssh. Copy the id_rsa.pub content to the remote host $HOST/.ssh/authorized_keys2 file

To disable Password Authentication:
vi /etc/ssh/sshd_config
PasswordAuthentication no # Default is yes

/etc/init.d/sshd restart

Converting a PuTTY key for SecureCRT

I've been using PuTTY for many years and I'm quite happy with it. Since I'm pursuing CCIE and CCIE lab is using SecureCRT, so I decide to switch to SecureCRT to familiarize with it.

The very first challenge is to convert my key pairs generated by PuTTYGen for SecureCRT use. Not as straight forward as I think...... Here are the steps:

1. Use PuTTYGen to load your existing private keys
2. Use "Conversions" to export private key in OpenSSH format named identity
3. Export your public key named identity.pub
4. Put both files in the same folder

Then Start your SecureCRT
1. Choose QuickConnect
2. Protocol = SSH2, and enter the hostname or ip address
3. Under the "Authentication" session, Only checked "PublicKey"
4. Click "Properties" at the right pane
5. Choose "Use Global public key setting"
6. Under "Use identity or certificate file" and choose your identity.pub and click ok.
7. Enter your passphrase and get connected!