Update: this can cause some of your ssh sessions to hang, so be aware of that.
Add this to your ~/.ssh/config
Host myserver.mydomain.com
ControlMaster auto
ControlPath /tmp/%r@%h:%p
Then, say you have root access via your ssh pub key
mkdir tmp001
sshfs -o uid=1000 root@myserver.mydomain.com:/var/www tmp001
Now, the files in tmp001 map to your remote /var/www directory. And access to them uses an ssh session that is maintained in your /tmp directory, i.e. all interactions are performed over the same ssh session.
To see the tmp file, if you just opened the sshfs session in the last 10 mins
find /tmp -mmin -10 -ls
Showing posts with label sshfs. Show all posts
Showing posts with label sshfs. Show all posts
Wednesday, 6 August 2014
Saturday, 5 October 2013
Edit files on a remote server via your Mac using ssh, sshfs and brew
- install latest xcode
- install brew
- install sshfs using brew
- make sure to change any permissions specified
- mkdir mytmpdir
- sshfs -o uid=<your local numerical id> root@<remote server>:<remote dir> mytmpdir
- e.g. sshfs -o uid=501 root@10.1.0.100:images mytmpdir
- edit files that appear in tmpdir, and when you save them, the remote files will be updated
Unmount
- umount mytmpdir
Thursday, 25 April 2013
Edit remote files with local editor using ssh and sshfs
- apt-get -y install sshfs
- Add your local user to the fuse group
- mkdir ~/mylocaldir
- sshfs -o idmap=user mylocaluser@myremoteserver.com:/remotepath ~/mylocaldir
- Edit files under ~/mylocaldir, and as you save them, they are automatically updated in /remotepath
Errors
- "Couldn't read packet: Connection reset by peer"
- change this line in your /etc/ssh/sshd_config file to match what's here
- Subsystem sftp internal-sftp
- happens on RedHat Enterprise 6.1 for sure
Subscribe to:
Posts (Atom)
Interview questions: 2020-12
Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer Networking Layer 1 vs Layer 4 haproxy u...
-
CRITICAL: AWS now offers internal VPC DNS! Below is no longer necessary AFAIK. Woo hoo! http://aws.amazon.com/about-aws/whats-new/2014/...
-
build sudo apt-get install git gcc sudo apt-get install automake autoconf git clone git://github.com/rriley/tsunami-udp.git cd tsunam...
-
From: https://bugs.eclipse.org/bugs/show_bug.cgi?id=382972#c4 Assumptions: jEdit was installed into /Applications directory. Close any...