Difference between revisions of "Passwordless SSH login with RemoteShell"

From MorphOS Library

(Created page with 'There are lots of tutorials about this for linux, but not much for MorphOS, even if the process is mostly the same. So when I started doing this, I decided to write down all step…')
 
m (markup)
 
Line 10: Line 10:
 
Step 2: Create public & private key pair
 
Step 2: Create public & private key pair
  
SYS:Applications/RemoteShell/Files/ssh-keygen -t rsa
+
<code>SYS:Applications/RemoteShell/Files/ssh-keygen -t rsa</code>
  
 
When asked for password, just press enter for none.
 
When asked for password, just press enter for none.
Line 18: Line 18:
 
Doesn't matter how you do it. With USB massstorage device:
 
Doesn't matter how you do it. With USB massstorage device:
  
copy sys:Applications/RemoteShell/Files/conf/id_rsa.pub UMSD0:
+
<code>copy sys:Applications/RemoteShell/Files/conf/id_rsa.pub UMSD0:</code>
  
 
Move the USB device to the server.
 
Move the USB device to the server.
  
Step 4: Add key to authorized keys
+
Step 4: Add key to authorized keys<br />
Mount the USB disk (if not done automatically)
+
Mount the USB disk (if not done automatically)<br />
 
Append the key to your list of authorized keys:
 
Append the key to your list of authorized keys:
  
cat /media/disk/id_rsa.pub >> ~/.ssh/authorized_keys
+
<code>cat /media/disk/id_rsa.pub >> ~/.ssh/authorized_keys</code>
  
 
NOTE: Use the path where the disk is mounted.
 
NOTE: Use the path where the disk is mounted.
  
Step 5: RemoteShell configuration
+
Step 5: RemoteShell configuration<br />
Preferences => Servers => Add
+
Preferences => Servers => Add<br />
Alias: Whatever you like
+
Alias: Whatever you like<br />
Server: Address of the server
+
Server: Address of the server<br />
Login: User name (on the server)
+
Login: User name (on the server)<br />
Password: Empty (unless you use one)
+
Password: Empty (unless you use one)<br />
 
Port: Whatever the server is using.
 
Port: Whatever the server is using.
  
 
When connecting to the server for the first time, RemoteShell asks if you want to continue connecting (as the host isn't yet marked as known). After answering yes, the connection will be done automatically.
 
When connecting to the server for the first time, RemoteShell asks if you want to continue connecting (as the host isn't yet marked as known). After answering yes, the connection will be done automatically.

Latest revision as of 11:48, 24 August 2020

There are lots of tutorials about this for linux, but not much for MorphOS, even if the process is mostly the same. So when I started doing this, I decided to write down all steps, in case someone else needs to do it in the future. I assume you already have a suitable unix / linux system properly configured. If not, google for some linux tutorial.

While "passwordless login" might sound terribly insecure, it's actually often more secure than traditional passworded login. Oversimplified, you "create a really secure & random password, which you upload to the server". In practice, this is of course quite a bit more complex (and more secure). Of course this can be combined with a password for even more protection.

Also note that MorphOS SDK comes with own SSH, SCP etc. which have their own config file. These instructions are for RemoteShell. Commands in SDK have their own config files, to which you can do the same changes.

Step 1: Set hostname You might want to set your hostname in Settings => Network => Host and DNS

Step 2: Create public & private key pair

SYS:Applications/RemoteShell/Files/ssh-keygen -t rsa

When asked for password, just press enter for none. Enter same password again.

Step 3: Get the public key to server Doesn't matter how you do it. With USB massstorage device:

copy sys:Applications/RemoteShell/Files/conf/id_rsa.pub UMSD0:

Move the USB device to the server.

Step 4: Add key to authorized keys
Mount the USB disk (if not done automatically)
Append the key to your list of authorized keys:

cat /media/disk/id_rsa.pub >> ~/.ssh/authorized_keys

NOTE: Use the path where the disk is mounted.

Step 5: RemoteShell configuration
Preferences => Servers => Add
Alias: Whatever you like
Server: Address of the server
Login: User name (on the server)
Password: Empty (unless you use one)
Port: Whatever the server is using.

When connecting to the server for the first time, RemoteShell asks if you want to continue connecting (as the host isn't yet marked as known). After answering yes, the connection will be done automatically.