What are you using to see and edit files on remote servers? reddit / selfhosted ---------------------------------------------------------------------- Kennephas · 2023-10-30 11:54 Hi all, I seem to see a lot of people using VSC over ssh to see the files and folders on their servers and edit them more conveniently than compared to nano/vim but I'm looking for alternatives for VSC. I have an increasing number of servers and hosting things with docker compose. Thus I have a lot of /app/docker folders with numerous docker-compose.yaml and other container specific config files. I dislike VSC so as an alternative I use Notepad++ with nftp plugin (yap, I'm daily driving Windows) to connect to the servers to see and edit said files. I also tried Jetbrain' fleet but it seems to intall some kind of client on the servers it connects to which requires just enough resources to notably slow down my cheap VPSes. So other than the 3 examples above, what kind of edit do you know/use to connect to servers and edit files there directly? ---------------------------------------------------------------------- Reasonable-Ladder300 · 2023-10-30 11:59 Usually on the remote i use lunarvim(neovim but with some default settings and plugins). Other than that I usually have everything as a git repo, so i edit on my local/remote ide) pycharm, vscode or vscode server). I edit the files push them to the repo and then i just pull the files on my host. I know this adds some steps to edit a simple file, but the version control etc can be a massive advantage depending on what you do. ---------------------------------------------------------------------- ElevenNotes · 2023-10-30 12:06 sshfs-win is something if you don't like vscode. ---------------------------------------------------------------------- Kennephas · 2023-10-30 12:09 Well, I haven't tough of that but man that seems a very good solution. Version controlling the yamls and other configs. I'm not aware of any particular solution but I bet there is some kind of tool which can monitor the repo on the server and automatically pull the changes if you push some from your workstation. ---------------------------------------------------------------------- basthen · 2023-10-30 12:43 I enjoy micro myself. Lightweight, copy paste, color coding and much more ---------------------------------------------------------------------- mrmclabber · 2023-10-30 12:57 iterm ---------------------------------------------------------------------- davedorm · 2023-10-30 13:06 \+1 for Micro, and either Midnight Commander or Ranger for navigation on the server. ---------------------------------------------------------------------- bufandatl · 2023-10-30 13:25 ls ---------------------------------------------------------------------- CatoDomine · 2023-10-30 14:07 I use git to manage my compose files, manifests and config files etc. I believe Github Actions has a docker workflow, not sure how to use it, but it might be worth looking at as a CI/CD to auto-deploy your containers once they are merged to main. I use .gitignore for my persistent volume folders if the container will write to them. ---------------------------------------------------------------------- meddig0 · 2023-10-30 14:35 For the most part I work directly on the server and use nano. Occasionally offload to VSC if it's a bit more intensive. I use VSC as my main Dev program at work though, I'm interested to know what you don't like about it? ---------------------------------------------------------------------- ffimnsr · 2023-10-30 14:58 It's a bad thing to edit files on remote servers if it's for production. I use immutable servers, so edit locally push to server when done. Anyways, the best way is Vim and ssh if you really want to. Or if there's a lot then use ansible to modify them all ---------------------------------------------------------------------- VerdwaaldeStutte · 2023-10-30 14:59 Emacs has TRAMP built in, so you can visit and edit files/directories from your local machine. ---------------------------------------------------------------------- Educational-Craft545 · 2023-10-30 15:04 This is interesting. Thanks for mentioning. ---------------------------------------------------------------------- ericesev · 2023-10-30 15:08 I use Ansible+git to push changes to remote servers. And use ssh+vim sometimes too. ---------------------------------------------------------------------- prime_1996 · 2023-10-30 15:38 I normally just SSH and use nano if the change is quick. If I need some copying and paste, I connect my file manager, Dolphin, to the server via Sftp, which allows me to edit files with a desktop app. And I have recently been using Cockpit with the navigator plugin, and it works great, I can edit files using the browser. ---------------------------------------------------------------------- ElevenNotes · 2023-10-30 16:07 Its just networks drives that are actually mounting a folder via SSH. ---------------------------------------------------------------------- NightH4nter · 2023-10-30 16:21 i ususally just use whatever is on the server, so, nano/vi/vim/neovim ---------------------------------------------------------------------- _murb · 2023-10-30 16:45 Vim or VSCode over ssh - depending on the workload. ---------------------------------------------------------------------- hannsr · 2023-10-30 16:52 Just add githooks and let them trigger when you push? ---------------------------------------------------------------------- Digital_Voodoo · 2023-10-30 16:54 Ok, I'll be the GUI guy: [Filebrowser](https://github.com/filebrowser/filebrowser). ---------------------------------------------------------------------- Nondv · 2023-10-30 17:11 emacs through ssh ---------------------------------------------------------------------- EmilGH · 2023-10-30 17:13 Nova ---------------------------------------------------------------------- tomhung · 2023-10-30 17:31 winscp + sublime text for quick in place edits. lazygit to manage the repo on the server. vscode + remote ssh plugin for bigger development Also ssh via kitty and vim ---------------------------------------------------------------------- Finagles_Law · 2023-10-30 17:37 Whatever flavor of Midnight / Total Commander is available for the platform I'm using, plus nano. ---------------------------------------------------------------------- adamshand · 2023-10-30 17:43 Ssh plus nano/vim. ---------------------------------------------------------------------- hbp112358 · 2023-10-30 17:47 Depends, but mostly ssh and vi, vim, or neovim depending on what was the default install. College habits die hard, and I did 4 years of college work with vi/vim. ---------------------------------------------------------------------- dcabines · 2023-10-30 17:59 Portainer can do that. ---------------------------------------------------------------------- Reasonable-Ladder300 · 2023-10-30 18:04 I should do this as well… ---------------------------------------------------------------------- ADVallespir · 2023-10-30 18:27 For 2 lines nano or vim, for large code vscode. ---------------------------------------------------------------------- ikus060 · 2023-10-30 18:42 I usually use vim/nano directly. I don't see the need to edit file directly very often. Following good DevOps practice, I usually push server configuration with an ansible playbook and most application are running on Docker. The number of time I need to edit config file is very minimal. But I would understand if ansible deployment is a bit too far for your self hosted need. ---------------------------------------------------------------------- 546875674c6966650d0a · 2023-10-30 18:49 Notepad++ over the network... pretty great setup in my opinion. ---------------------------------------------------------------------- Ok-Honeydew6382 · 2023-10-30 19:07 This, all the best from gui text editors in a cli form ---------------------------------------------------------------------- Heas_Heartfire · 2023-10-30 20:06 For projects I need to actually debug I just use VSC with ssh, for quick edits just ssh and nano, otherwise WinSCP, specially if I have to upload files to the server or move them around. ---------------------------------------------------------------------- snowbanx · 2023-10-30 20:07 Ssh and nano, but I just figured out the other day that if you use MobaXterm to ssh in, you get a Gui file browser/file editor as well as the shell. ---------------------------------------------------------------------- JoeB- · 2023-10-30 20:07 On LAN, either... 1. [Pulsar](https://pulsar-edit.dev/) (fork of Atom) with a the Ftp- Remote-Edit package that enables editing over sftp, or 2. ssh + nano or vim. ---------------------------------------------------------------------- chandz05 · 2023-10-30 20:28 I usually do Notepad++ over SFTP I also spun up a code-server instance with access to my configs if I don't have access to Notepad++. ---------------------------------------------------------------------- GoobyFRS · 2023-10-30 20:52 [MobaxTerm](https://mobaxterm.mobatek.net/) ---------------------------------------------------------------------- zarlo5899 · 2023-10-30 21:00 ssh and vscode if i want a UI or just ssh and what ever editor is installed on the server ---------------------------------------------------------------------- billiarddaddy · 2023-10-30 21:21 vi ---------------------------------------------------------------------- MRP_yt · 2023-10-30 21:26 While i was using Windows - MobaxTerm Now that i switched to MINT - Tabby ---------------------------------------------------------------------- virtualadept · 2023-10-30 21:27 SSH to shell in. vi to edit text. ---------------------------------------------------------------------- esturniolo · 2023-10-30 21:32 Lunarvim. Thank you sir for this thing that I just discovered. Take my upvote stranger. ---------------------------------------------------------------------- Alekspish · 2023-10-30 22:18 Get mobaxterm. It has scp built into the ssh session when you connect so you can see the files on the remote server and then edit them in a text editor and save directly to the remote server. Give it a go you will find it's exactly what you are after ---------------------------------------------------------------------- jpdsc · 2023-10-30 22:22 90% with Ansible from local repo. ---------------------------------------------------------------------- Reasonable-Ladder300 · 2023-10-30 22:23 Well we’ve come full circle, i found i through another stranger suggesting it on reddit. Haven’t look back since. ---------------------------------------------------------------------- Jedkea · 2023-10-30 22:29 This. Take the time and learn vim. It is so worth it. There is a training program that ships with it on most distros ---------------------------------------------------------------------- Nagashitw · 2023-10-30 23:37 I use this for my NFS mount. Works well. ---------------------------------------------------------------------- Nagashitw · 2023-10-30 23:57 Yeah if it's homelab stuff it's fine to use vim or vscode but for work usually you would want things as declarative as possible to replicate it to other servers as well, or even for disaster recovery ---------------------------------------------------------------------- Digital_Voodoo · 2023-10-31 00:00 Oddly enough, I couldn't get it to work with rclone mounts. Still trying various options. Seems like a VFS issue, at least from what I've read so far. ---------------------------------------------------------------------- HoustonBOFH · 2023-10-31 00:23 Was looking for this before I posted it. I am rarely on Windows, but when I am, MobaXTerm is the answer. SSH, SCP and X tunnels all in one place. ---------------------------------------------------------------------- tenekev · 2023-10-31 01:02 VSCode + Remote client. Least painless. Also ansible for already established environments. ---------------------------------------------------------------------- itachi_konoha · 2023-10-31 02:10 vim seems too troublesome for me. Nano is so easy. ---------------------------------------------------------------------- UnicodeConfusion · 2023-10-31 02:47 SSH + vifm ([https://vifm.info](https://vifm.info)) ---------------------------------------------------------------------- esturniolo · 2023-10-31 05:40 The live definition of “community” ---------------------------------------------------------------------- MK68i · 2023-10-31 05:42 filebrowser ---------------------------------------------------------------------- thecomputerguy7 · 2023-10-31 05:58 Does this work with SSH keys? ---------------------------------------------------------------------- ElevenNotes · 2023-10-31 06:19 Yes. ---------------------------------------------------------------------- Do_TheEvolution · 2023-10-31 07:48 * windows - mobaXterm * linux - nnn file manager on the machine, with fzf plugin, and micro editor ---------------------------------------------------------------------- a_40oz_of_Mickeys · 2023-10-31 08:07 I connect via winscp to browse files and it has an editor but you can have it open files using whichever program you want. I stick with VS Code. ---------------------------------------------------------------------- KillerTic · 2023-10-31 08:42 For sure not best practice, but I have a SMB share on my servers for the Docker folder and mount it on my dev machine. Recently switched to a dev VM on my hypervisor, which has VSCode Server from Coder running. It also has the different shares mounted. Now I can VPN in from anywhere, switch on my dev VM and do whatever needs doing with my full environment available to me. ---------------------------------------------------------------------- leaflock7 · 2023-10-31 08:58 not the OP, but really interested on the following. I was able to setup VSC etc for remote ssh and edit, but the problem is that when you need to sudo, then this does not translate. VSC will use the credentials of the account you used to connect , but could not figure out how to elevate with sudo or another account when you need to. did you manage to do that? ---------------------------------------------------------------------- meddig0 · 2023-10-31 09:02 Aaah ok, that makes sense. I've not hit that issue - at work we use RHEL so I can just go straight in as root where required. On my VPS, I set up accounts with groups/permissions for what is required. So all my docker files, for example, are owned and managed by "admdocker:docker" so I don't need to sudo to do anything with them. I suppose I try and avoid a sudo when working on scripts or config files if I can. If I need to, I'll do it on the box. ---------------------------------------------------------------------- leaflock7 · 2023-10-31 09:06 that is one way to go for sure, unfortunately there are a lot of setups that you have an account based auth, and not always proper groups are configured (as they should tbh). Thanks you very much for the reply ! ---------------------------------------------------------------------- meddig0 · 2023-10-31 09:07 Absolutely, it's nice if you have the luxury of building everything from scratch and doing things the right way. I might have a tinker when I have some time. I can't remember what extension I used in vscode off the top of my head. Should I discover anything, I'll pop a reply here :) ---------------------------------------------------------------------- utopiah · 2023-10-31 09:18 ssh vim but within a screen, this way I maintain the state, e.g vim stays open on the configuration file or the code, and I can have multiple "windows" per project, all easy to switch to. ---------------------------------------------------------------------- leaflock7 · 2023-10-31 12:06 thanks!! probably was remote-ssh , remote-explorer or something similar ---------------------------------------------------------------------- saintjimmy12 · 2023-10-31 14:41 Why not using VSCodium ? VSCode without the bullshit and extension still works ! ---------------------------------------------------------------------- 0x4510 · 2023-10-31 15:35 The barrier to entry is definitely higher, but there are definite benefits once you figure it out. Basic usage (insert mode, saving files, and navigating) should be sufficient for you to be able to edit files, and shouldn't take more than 10 minutes or so to figure out. ---------------------------------------------------------------------- itachi_konoha · 2023-10-31 15:38 What vim has which Nano doesn't? I never tried vim that much after the initial experience so was wondering is there any big advantage of vim? ---------------------------------------------------------------------- 0x4510 · 2023-10-31 15:53 Once you get used to it, it's much faster to do a lot of things. You can run macros, jump around the file, etc really easily. Watching someone edit a file in vim can look like straight up magic. ---------------------------------------------------------------------- ghoarder · 2023-10-31 16:52 Most often: Guacamole + SSH + Nano [https://hub.docker.com/r/guacamole /guacd](https://hub.docker.com/r/linuxserver/guacd) Backup: Webtop + Nano/Text Editor [https://hub.docker.com/r/linuxserve r/webtop](https://hub.docker.com/r/linuxserver/webtop) Specifically writing code: Code-server (VSCode in browser) [https://hub.docker.com/r/linuxserver/code- server](https://hub.docker.com/r/linuxserver/code-server) ---------------------------------------------------------------------- thecomputerguy7 · 2023-11-01 02:01 I got it working with the helper GUI and even got it working with VSCode too. Thank you for suggesting it ---------------------------------------------------------------------- ElevenNotes · 2023-11-01 02:49 You're welcome, its pretty nice for Windows. ---------------------------------------------------------------------- thecomputerguy7 · 2023-11-01 02:57 I won’t lie, I wasn’t expecting it to be as responsive as it was in VSCode, but windows explorer was still a little laggy. Still plenty usable though ---------------------------------------------------------------------- smashjarchivemaster · 2023-11-01 03:31 Nautilus on my linux laptop can mount sftp as if it were a physically attached drive. You can even right click empty space in the folder to get the option of "Open in Remote Terminal" or "Open in Local Terminal". ---------------------------------------------------------------------- gazsiazasz · 2023-11-01 13:43 >Once you get used to it, it's much faster to do a lot of things. You can run macros, jump around the file, etc really easily. Watching someone edit a file in vim can look like straight up magic. it can work without having ctrl keys function keys modifier keys or arrow keys