SSH

# public key authentication

$ ssh-keygen -t rsa
$ scp id_rsa.pub <user>@<remote-ip>:~/.ssh/id_rsa.pub

/etc/ssh/sshd_config

# example changes

PermitRootLogin no
AllowUsers administrator
AllowGroups administrator
Port 2222
ListenAddress 192.168.0.2

Transferring Files

(Almost) All The Ways to File Transfer

python

# sender
python -m http.server <port> # python 3
python -m SimpleHTTPServer <port> # python 2
# receiver
wget <sender_ip:port>/<file> # or web browser

nc

# sender
nc <target_ip> <port> < send_file.txt
# receiver
nc -lnvp <port> > rec_file.txt

scp

ssh remote_user@ip # connect to computer with file
scp <file> <user>@<ip>:<remote_dir> # local or remote or other

ftp

ftp> put
ftp> get

sftp

sftp remote_user@ip

(l)pwd # (local) pwd
(!)dir # (remote) dir
(l)cd # (local) cd
put <file> # transfer

# sftp chroot

# add user to group
usermod -g <group> -s /bin/false <user>
$ gedit etc/ssh/sshd_config
# change
Subsystem sftp /usr/libexec/openssh/sftp-server -> Subsystem sftp internal-sftp
# add to bottom
Match Group <group-users-are-in>
X11Forwarding no
AllowTcpForwarding no
ChrootDirectory /home
ForceCommand internal-sftp

Remmina

xvncviewer