[EN] Access to your server


Can I use SSH / SFTP / FTP ? 27. sep 2013

It depends on the product that you have with us. If you have a single webhotel on a shared server, the rule of thumb is that you only get FTP. If you have a virtual- or dedicated server, you can most likely choose between SSH, SFTP and FTP. Here is some information about each of the protocols in use:

  • With a SSH account you can also use SFTP, but not the other way around.
  • SSH accounts always uses key based authentication.
  • SFTP-only accounts can in rare cases be created with username/password authentication, but we don't recommend it.
  • FTP is insecure - there isn't any encryption on neither authentication or content.
  • All protocols are behind a firewall, and we never open for the entire Internet. Always specific IP's or subnets.
  • We usually recommend SSH and don't really like FTP.

How do I use key based authentication? 27. sep 2013

First check that you don't already have a private/public key pair: ls ~/.ssh Check if the directory listing either has a id_rsa.pub or id_dsa.pub. If not, proceed with the key generation below.

Generate a key pair with the command ssh-keygen -t rsa -b 4096 -C "your-email@example.com". When asked where to save the key, keep the default. When asked to enter passphrase, enter a good passphrase to secure the private key.

You should now have 2 files, the private key ~/.ssh/id_rsa and the public key ~/.ssh/id_rsa.pub. NEVER give the private key to anyone and don't copy it to other machines ( if you have several computers, generate separate key pairs on each ).

The public key should be uploaded to the server and appended to the file ~/.ssh/authorized_keys. If this is the first time you need access, you can send the key to us and we will place it there to give you access. Afterwards you can manage the key file yourself by adding (or removing) keys to give (or revoke) access.


How do I use key based authentication with putty? 13. dec 2013

Start putty.exe and follow these instructions.

  • Select a previously stored session or create a new one.
  • Store your username by prepending it to the Host Name (or IP address), seperating the username and hostname with an @-sign.
  • In the Category-list on the left hand side, unfold SSH underneath the Connection group.
  • Select Auth and click Browse under Private key file for authentication and browse to the directory of your private key file.
  • Select your private key file and click Open, then return to Session and click Save to store the settings for next time you open putty.

You can now connect to the server using key based authentication by clicking Open.


How do I generate a key pair to use with putty? 13. dec 2013

Download puttygen.exe from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html and follow these instructions to generate a key pair.

  • Under Parameters select SSH-2 RSA.
  • Set number of bits in generated key to 4096.
  • Click Generate and follow the instructions till generation is complete.
  • When complete, you can optionally protect your private key using a passphrase.
  • Save both your public and private keys on your computer by clicking Save public key and Save private key.

The public key under Public key for pasting into OpenSSH authorized_keys file should be uploaded to the server and appended to the file ~/.ssh/authorized_keys. If this is the first time you need access, you can send the key to us and we will place it there to give you access. Afterwards you can manage the key file yourself by adding (or removing) keys to give (or revoke) access.


How do I create a SSH tunnel? And what is the purpose? 27. sep 2013

If you already have SSH access to the server, you can easily create a SSH tunnel. In this example we will create a SSH tunnel, so you can connect to the servers MySQL server directly.

MySQL us running on port 3306 on the server, but because of the firewall you can't connect to it directly. On your local machine try running this command: ssh -Ng -L 3306:127.0.0.1:3306 sshuser@server.pil.dk ( you should replace sshuser with your actual username and server.pil.dk with the hostname ).

Afterwards, in another local terminal, you can connect directly to database with: mysql -h 127.0.0.1 -P 3306 -u mysqluser -p mysqldatabase

When connected, you are using an encrypted ssh connection to talk "directly" to mysql on the remote server.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk