Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- IPHOST=$(ipconfig /all | grep Passe | cut -d':' -f2 | tr -sd ' ' | tr -d '\r')
- echo "IPHOST=$IPHOST"
- read -p "Quel est votre user (cuid) ? " USER
- if [ ! -e /etc/sshd_config ]; then
- cat > /etc/sshd_config <<EOF
- Port 22
- AuthorizedKeysFile .ssh/authorized_keys
- AllowTcpForwarding yes
- X11Forwarding yes
- Subsystem sftp /bin/sftp-server
- EOF
- fi
- sleep 1
- echo "Start sshd in background..."
- ssh-keygen -A
- /usr/bin/sshd
- sleep 1
- echo ssh -N -R 2222:127.0.0.1:22 $USER@$IPHOST
- ssh -N -R 2222:127.0.0.1:22 $USER@$IPHOST
Advertisement
Add Comment
Please, Sign In to add comment