Hi, when using the awesome **rmate** to remote-edit some files I ran into the problem that I had to use sudo for writing into a file.
ubuntu@ubuntu:/etc/apache2$ rmate httpd.conf File httpd.conf is not writable! Use -f/--force to open anyway.
ubuntu@ubuntu:/etc/apache2$ sudo rmate httpd.conf ubuntu@ubuntu:/etc/apache2$ /usr/local/bin/rmate:157:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED) from /usr/local/bin/rmate:157:in `new' from /usr/local/bin/rmate:157:in `connect_and_handle_cmds' from /usr/local/bin/rmate:207:in `block in <main>' from /usr/local/bin/rmate:206:in `fork' from /usr/local/bin/rmate:206:in `<main>'
The documentation mentions a sudo-replacement *rvmsudo* which keeps the environment. But this seems not to part of the standard repositories, which makes it nearly impossible to install it on a clients machine.
Any idea?
Kind regards, Ingo
On 5 Jul 2014, at 7:26, Ingo Lantschner wrote:
ubuntu@ubuntu:/etc/apache2$ sudo rmate httpd.conf ubuntu@ubuntu:/etc/apache2$ /usr/local/bin/rmate:157:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
Could it be that you have configured host/port for your regular user in ~/.rmate.rc?
If this is the case, rmate could likely be update to check if SUDO_USER is set, and if so, read that user’s settings.
The documentation mentions a sudo-replacement *rvmsudo* which keeps the environment […]
Or maybe you have setup RMATE_HOST/RMATE_PORT, in that case you’ll need to whitelist them. See ‘man sudoers’.
Am 05.07.2014 um 21:05 schrieb Allan Odgaard mailinglist@textmate.org:
Or maybe you have setup RMATE_HOST/RMATE_PORT, in that case you’ll need to whitelist them. See ‘man sudoers’.
Thanks Allan - that took me a step further!
Just for the records:
1. You **must** tell sudo to keep at least RMATE_HOST $ sudo visudo …
Defaults env_reset Defaults env_keep +="RMATE_HOST" …
2. Seems as if `RMATE_HOST=auto` does not work this way. I had to set explicitly the host-IP; e.g. RMATE_HOST=192.10.11.13
Cheers, Ingo