# 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
(Almost) All The Ways to File Transfer
# sender
python -m http.server <port> # python 3
python -m SimpleHTTPServer <port> # python 2
# receiver
wget <sender_ip:port>/<file> # or web browser
# sender
nc <target_ip> <port> < send_file.txt
# receiver
nc -lnvp <port> > rec_file.txt
ssh remote_user@ip # connect to computer with file
scp <file> <user>@<ip>:<remote_dir> # local or remote or other
ftp> put
ftp> get
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