![]() Use the sshfs command with the -f flag to run SSHFS in the foreground, which can be useful for debugging.Use the scp command to securely transfer files between the local and remote computers.Use the tar command to compress and decompress files on the remote filesystem.Use the rsync command to transfer files between the local and remote filesystems.Use the umask command to set the default file permissions on the remote filesystem.Use the -o BatchMode=yes flag with SSh to prevent the client from prompting for passwords or passphrases.Use the -o ServerAliveInterval=30 flag with SSh to send a keep-alive packet every 30 seconds to prevent the connection from timing out.Use the -o reconnect flag with SSHFS to automatically reconnect to the remote filesystem if the connection is lost.Use the -C flag with SSHFS to enable compression, which can improve performance over slow networks.Here are some tips and tricks to enhance your SSh filesystem experience: Mount the remote filesystem on the local computer using the command: $ sudo sshfs -o allow_other,IdentityFile=~/.ssh/id_rsa /mnt/remoteĪccess the remote filesystem by navigating to the mount point /mnt/remote on the local computer. This method can be used for any service, so if you are setting up apache or Nginx inside a LXC you can do the same port forwarding for ports 80, 8080, 443 etc etc.7). the host will forward the traffic to your LXC. Ssh -p 25001 that its the host servers ip you need to target and not the LXC. Once complete you should be able to login with via ssh with the following ![]() this will forward ssh traffic from your host server to your LXC on the correct port Where eth0 should be your LXC ethernet card and 10.x.x.x is your LXC internal ip address. Iptables -t nat -A PREROUTING -i eth0 -p tcp -dport 25001 -j DNAT -to 10.x.x.x:25001 once you have changed this add the following iptables rule on your host server, not your LXC. ![]() NB all unique LXC instances on the host server will need to use a different ssh port. ![]() To do this you will need to open up /etc/ssh/sshd_config on your LXC instance and change the listening port for SSH to a different port than your host server.įor example set your host to 25000 and set your LXC to 25001. you will need to apply an iptables rule that allows port forwarding from your host server to the LXC internal natted IP address. ![]() As your LXC will have an internal IP address for example 10.x.x.x. ![]()
0 Comments
Leave a Reply. |