en.opensuse.org

Programs over SSH

This is about doing an automated ssh connection to a server. All is only tested with Linux machines. If it will work with any other OS, I have no idea. First some naming in the explanation below.
Server : The machine you connect to.
Client : The machine you make the connection from.
luser : Local User or user on the client
ruser : Remote User or user on the server

You must be able to make a connection from the local machine to the remote machine with the command

ssh ruser$Server
If this fails there can be various reasons, but most likely in order of appearance are:
  • The firewall on Server still blocks port 22.
    Open it or run ssh on a different port that is or can be opend.
  • sshd is not running,
    See that ssh runs on the remote machine and that settings are that you are able to connect. e.g. the user ruser is the one that is allowed to connect and not luser.
  • ssh is not running on your local machine.
    Well, install it. Most Linux distributions have it installed by default.

First you need to create a public key on the client. This only needs to be done once.

ssh-keygen -t rsa
It will ask where to place it. The default should be good.
It will ask for a passphrase. Just press enter there. Twice.

You now will need to let the server know who you are.

ssh-copy-id -i ~/.ssh/id_rsa.pub ruser@server
If you have never made a connection over ssh to that server, you will be asked if you accept the finger print. Press yes there and then enter the password for ruser.
The screen says it all then. Do `ssh ruser@server` and check the keys. You will notice that the password is not asked anymore

If you have installed sshfs you can now do something like `sshfs ruser@server:/home/ruser ~/ruser_server` after you made on the client the directory ~/ruser_server.

Install openSUSE remotely