ssh
ssh is the normal way of getting command-line access to a Linux/Unix system.
Windows ssh client: PuTTY
- PuTTY (free)
- PuTTY download
- PuTTY FAQ
- Some settings you might change:
- Connection - Data - username
- Right-click bar - Change settings - Colors - Use system colors
- Change settings - Appearance - Change font
- Stop sessions timing out when idle: Connection - "Seconds between keepalives" - set value to say 30
- Window - Behaviour - Warn before close - off
- Copy-and-paste
is strange on PuTTY:
- Copy - Select text
- Paste - Right-click (or Shift-Insert)
- Right-click Paste is rather dangerous, so you can change this:
- Window - Selection - Right brings up menu
An ssh key
is a key kept as a file on your computer, that must match another key on the server.
The key is
huge (like around 1600 characters)
so unlike a password cannot be guessed by bots.
If you use ssh keys to login to Linux, you do not need a password.
- Login to Linux
- Setup a .ssh directory if it does not exist
mkdir ~/.ssh
- Generate keypair using
ssh-keygen
cd ~/.ssh
ssh-keygen
Hit enter to accept default filename.
Hit enter to skip passphrase.
-
Result is private and public key files:
- Append public key to authorized_keys:
cat id_rsa.pub >> authorized_keys
- Hide authorized_keys:
chmod go-rwx ~/.ssh
chmod go-rwx ~/.ssh/authorized_keys
This is important. Clients may generate cryptic errors if authorized_keys is not hidden.
- Copy private key to your PC.
There could be various ways of doing this.
- To use private key with PuTTY:
- Now you have a private key on your PC,
you tell your ssh and sftp clients to use this private key instead of a password.
You need to tell it username.
-
You will find it logs you in with no password.
sftp or similar is the normal way of getting remote read-write file system access to Linux/Unix systems.
How to turn an sftp site into a drive
If you have a Windows client and a Linux server,
you can use sftp to turn the Linux server into a
drive on Windows,
like the X: drive.
sftp likes a silent shell