| Start |
|---|
| Connecting to a remote server To connect to a server we must use SSH on the client as follows,
For a real world example lets pretend that you're making a website. The company you chose to host your site tells you that the server is located at web-servers.com on a custom port of 2020 and your account name usr1 has been chosen to create a user on the server with SSH privileges. In this case the SSH command used would be as such If account name on the remote system is the same as the one one the local client you may leave the user name off. So if you are When a server you want to connect to is not directly accessible to you, you can try using ProxyJump switch to connect to it through another server which is accessible to you and can connect to the desired server. This will let you connect to the server 10.0.0.2 (running ssh on port 2222) through server at 10.0.0.1 (running ssh on port 2020). You will need to have accounts on both servers of course. Also note that the -J switch is introduced in OpenSSH version 7.3. |
| Installing OpenSSH suite Both connecting to a remove SSH server and accepting SSH connections require installation of Debian: Arch Linux: Yum: |
| Generate public and private key To generate keys for SSH client: For example: Default location is For more info, please visit man.openbsd.org (opens new window) |
| Configuring an SSH server to accept connections First we must edit the SSH daemon config file. Though under different Linux distributions this may be located in different directories, usually it is stored under Use your text editor to change the values set in this file, all lines starting with # are commented out and must have this character removed to take any effect. A list of recommendations follow as such. Note that it is preferable to disable password logins all together and use SSH Keys for improved security as explained in this document. |
| Passwordless connection (using a key pair) First of all you'll need to have a key pair. If you don't have one yet, take a look at the 'Generate public and private key topic'. Your key pair is composed by a private key (id_rsa) and a public key (id_rsa.pub). All you need to do is to copy the public key to the remote host and add its contents to the One simple way to do that is:
Once the public key is properly placed in your user's home directory, you just need to login using the respective private key:
|
| Disable ssh service This will disable the SSH server side service, as if needed this will insure that clients cannot connect via ssh Ubuntu Debian Arch Linux |
Read Article
https://develop.horje.com/learn/1434/reference