Skip to content

Instantly share code, notes, and snippets.

@davebeach
Last active June 3, 2018 01:53
Show Gist options
  • Save davebeach/8ba107047a29c3b11404d1f332220911 to your computer and use it in GitHub Desktop.
Save davebeach/8ba107047a29c3b11404d1f332220911 to your computer and use it in GitHub Desktop.
To Connect to Your HANA Express Server MACOS

HANA Express Server

Connect to HANA Express Server (HANA XS/XSA)

Purpose

The SAP instructions don't always have the macos instructions. This is pretty standard on the macos side, but if unable to connect SSH to the HANA server, please read below.

Use Case

You need to pull files from the HANA Express Server

Verify Existing Keys Exist

In your terminal application (bash or zsh), issue the command: ls -al ~/.ssh

If nothing exists then follow these instructions, otherwise skip to next section:

Create the directory for your keys. Note the .ssh directory does not show up in Finder unless you allow for hidden files. For terminal you need to ls -a to see dot notation files.

cd ~
mkdir .ssh
cd .ssh

Generate Your Keys (If You Don't Have Them)

Only do this if you do not have a .ssh diretory and had to create it. Generate your key. The ideal key strength is currently 4096, however not all servers accept the larger key.
For 4096

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

For 2048

ssh-keygen -t rsa -b 2048 -C "your_email@example.com"

Press enter to accept the defaults as your first keys should default to id_rsa.pub and id_rsa. If you do this again, you will need to set a different name. Be careful not to create too many keys, do not delete keys, as it is difficult to manage them, and if you delete a key and it was used, you no longer can access what the key was used for (possible ever).

To view the keys

cd ~\.ssh
ls -al

Then add your keys to the ssh agent

eval "$(ssh-agent -s)"

If macos version 12.2 (Sierra) or later

Check if you have a config file

cd ~\.ssh
ls -al

If config file exists then modify as below or if it doesn't exist create it:

touch config
nano config

Modify file to say:

Host *
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/id_rsa

Add you key to ssh agent

ssh-add -K ~/.ssh/id_rsa

Verify Correct Permissions

If server rejects your key, it is probably due to permissions on your .ssh directory and key files.

For the .ssh directory the permissions should be drwx----- or 0700 For the public key -rw-r--r-- or 0644 For the private key -rw------- or 0600

Setup Server User Account and Add to wheel group

To connect to the HANA Express server. You first need an account on the server, as the systems administrator to set you up with a LINUX id. Instructions:

Different distros might have different instructions here. For RHEL 7 or CENTROS 7:

adduser [user id]
psswrd [user id]
usermod -aG wheel [user id]

Google "[your linux distro] create sudo user" if you are on another distro for instructions.

Download Cyberduck

Cyberduck is the open source file transfer program, that has SSH ability. Download here

Setup

File>Open Connection Select from drop down SFTP (SSH File Transfer Profile) Put in the server name of HANA Express instance and port 22 Use user name and password for the LINUX system above where you created user.

Click on add to keychain

You should not have to identify the private key location, as you registered that above, if that doesn't work then on second attempt, put in the private key file.

CONNECT

HANA Express Download Locations

Depends on which SAP HANA express was installed (use grep to search)

/hana/shared/INSTALL/DATA_UNITS

Use Cyber duck to download file

Find File and Right Click and Download.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment