No router + no screen + regular Ethernet cable + RPI 2 + Raspbian Lite 2018-11-13 + Ubuntu 18.10
First we need to enable the SSH server on Pi, which is disabled by default for security.
If you already have a shell for Pi through a non-SSH method, such as screen + keyboard or UART (see below), just run:
sudo systemctl enable ssh sudo service sshd start
as explained at: https://raspberrypi.stackexchange.com/questions/58478/ssh-not-working-with-fresh-install This is saved at boot time.
Otherwise, insert the SD card into your host and create a magic empty file called ssh file in the boot/ section.
On Ubuntu hosts, it is mounted automatically, and you can do it simply:
sudo touch /media/$USER/boot/ssh
which you can confirm with:
lsblk
which contains:
mmcblk0 179:0 0 14.4G 0 disk ├─mmcblk0p1 179:1 0 43.9M 0 part /media/ciro/boot └─mmcblk0p2 179:2 0 14.4G 0 part /media/ciro/rootfs
If you do not enable the SSHD daemon on the Pi, then the SSH connection will fail with:
ssh: connect to host 10.42.0.160 port 22: Connection refused
when we try it later.
After turning on the SSH server
Then download the Pi and connect the Ethernet cable from your laptop directly to the Pi:

In Ubuntu 17.04, in order to get around this error, as indicated in this answer, you first need to:
sudo apt-get install dnsmasq-base
On the host, open the network manager:
nm-connection-editor
And go:
+ sign (add a new connection)- Ethernet
- Create
- IPv4 Settings
- Method: Common to other computers
- Set a good name for this.
- Save

Find IP Pi on the host:
cat /var/lib/misc/dnsmasq.leases
outputs something like:
1532204957 b8:27:eb:0c:1f:69 10.42.0.160 raspberrypi 01:b8:27:eb:0c:1f:69
10.42.0.160 is IP, while as usual:
ssh pi@10.42.0.160
I also have the following in my .bashrc :
piip() ( cat /var/lib/misc/dnsmasq.leases | cut -d ' ' -f 3; ) pissh() ( sshpass -p raspberry ssh "pi@$(piip)"; )
Please note that inside the Pi, it can normally access the Internet through other interfaces of your host:
ping google.com
For example, on my laptop, Pi uses Ethernet, but the host is also connected to the Internet via WiFi.
A crossover cable is not required if the host network card supports Auto MDI-X . This applies to the very latest hardware, including, for example, the 2012 Lenovo T430 on which I tested, which has an "Intel® 82579LM Gigabit Network Connection" that documents support for Auto MDI-X .
Now you can also:
UART Serial USB Converter
This is an alternative to SSH if you just want to get a shell for Pi: https://en.wikipedia.org/wiki/Serial_port
It does not use SSH or the network itself, but an older one, simpler, more direct, more reliable, with lower bandwidth and shorter serial interface distance. Pi will not have access to the Internet with this method.
Desktop computers still have a serial port that can be connected directly to the network with Pi, but they are hidden in most laptops, so we need to buy a cheap USB adapter. Here I used: https://www.amazon.co.uk/gp/product/B072K3Z3TL See Also: https://unix.stackexchange.com/questions/307390/what-is-the-difference-between- ttys0 -ttyUSB0-and-ttyama0-in-Linux / 367882 # 367882
First, connect the SD card to the host and edit the config.txt file present in the first section, adding:
enable_uart=1
as explained at: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=141195
This first section contains the bootloader, its configuration files and the (Linux / your) kernel, config.txt is one of them. The second section contains the current root Linux file system.
Now connect your computer to the Pi as:

You only need to connect 3 cables:
- Earth to earth
- Tx Pi to Rx USB to Serial Port
- Rx to Pi to Tx to USB to serial port
This is also documented at: https://www.raspberrypi.org/documentation/usage/gpio/README.md.
Be careful not to connect the Earth with 5 V, I already recorded 2 UART on USB and RPI UART chips, doing this!
You do not need to connect 5V to 5V at all. I think you can power your Pi this way, but I read that this is a bad idea, just use a regular USB power supply.
Finally, plug the USB connector into your host computer and get a shell with:
sudo apt install screen sudo usermod -a -G dialout $USER screen /dev/ttyUSB0 115200
Exit with Ctrl-A \ .
Here is a video from Adafruit showing it: https://www.youtube.com/watch?v=zUBPeoLW16Q
see also
A similar question on RPI SE: https://raspberrypi.stackexchange.com/questions/3867/ssh-to-rpi-without-a-network-connection