ssh-keygen -t rsa
creating private and public keysssh backup@192.168.0.11 mkdir -p .ssh
create .ssh dir as a backup usercat .ssh/id_rsa.pub | ssh backup@192.168.0.11 'cat >> .ssh/authorized_keys'
uploading generated public keyssh backup@192.168.0.11 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
setting permissionsssh backup@192.168.0.11
logging without password freely
Source: https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/
Match User webmaster PasswordAuthentication yes ChrootDirectory %h ForceCommand internal-sftp AllowTcpForwarding no AllowAgentForwarding no PermitTunnel no PermitTTY no X11Forwarding no
useradd -k /etc/skel -s /sbin/nologin -d /var/www/htdocs/sites/web -m webmaster password webmaster
/etc/rc.d/sshd restart
chown root:webmaster /var/www/htdocs/sites/web webmaster mkdir /var/www/htdocs/sites/web/content chown webmaster:webmaster /var/www/htdocs/sites/web/content webmaster
Source: https://www.bsdnow.tv/tutorials/chroot-sftp
- HOME
~~~~~~~~~~~~~~~
- OpenBSD
- NetBSD
- FreeBSD
- Linux
- Solaris
- Windows
~~~~~~~~~~~~~~~
- Git
- Ansible
- Atlassian
- Network tools
- Qemu
- Virtualbox
- Vim
- Tmux
- Mutt
- STar
~~~~~~~~~~~~~~~
- MySQL
- PostgreSQL
- Postfix
- OpenSSL
- tcpdump
- SSH
~~~~~~~~~~~~~~~
- Packet Filter
- IP Filter
~~~~~~~~~~~~~~~
- Bash
- web-dev
- Hacking
- LINUX DAYS