LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-12-2021, 02:51 PM   #1
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 22.04
Posts: 2,125

Rep: Reputation: 73
Edit html on the server


Before, I only ever had shared hostings, which usually come with cPanel or Plesk. Both of which are great.

Now I have a cloud server with Ubuntu 20.04

nano is a great tool, but I would prefer to use something a bit more sophisticated.

Turbocapitalist told me to avoid using graphical interfaces on the server.

On my localhost, I use Bluefish.

Is it possible to open edit and save remote files using Bluefish?

Or is there some other cool tool?

EDIT: It's amazing! I use Filezilla to upload files to the server.

I found, if I right click in Filezilla, I can open a file from the server in Bluefish on my local machine, edit it, save it and Filezilla will re-upload!

That is good enough for me!

Last edited by Pedroski; 11-12-2021 at 03:44 PM.
 
Old 11-13-2021, 01:11 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
FWIW, I usually use sshfs do locally mount the remote filesystem, then edit and move/delete files with my usual GUI tools.
In 7 years of maintaining two servers I have never used filezilla.
 
Old 11-13-2021, 01:23 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,383
Blog Entries: 3

Rep: Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774
I second the recommendation for using sshfs for that. However, it should be mentioned that Bluefish has an upload/download function, with the same for normal Save As, at least on one desktop I have.

File -> Save As -> Other Locations -> Connect to Server -> sftp://pedroski@www.example.com/

They both seem to use the basic file manager for operations, so it may be different on a different desktop setup. You'll have to check.

Edit: Open will also work with remote connections like that.

Last edited by Turbocapitalist; 11-13-2021 at 01:25 AM.
 
Old 11-13-2021, 09:31 PM   #4
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 22.04
Posts: 2,125

Original Poster
Rep: Reputation: 73
Thanks for the replies.

I will read up on sshfs!

I will also try the upload function from Bluefish. That seems to be for whole folders, not single files.

But first, I tried to save 1 file on the server from my laptop. My user name on the server is pedro.

I thought I would be prompted for my password.

I entered

sftp://pedro@www.mywebsite.com/20BE4/

in the "Connect to Server" box in Bluefish

I get:

Quote:
Unable to access location
Connection refused by server
I can access the server via ssh, no problem.

I obviously need to allow Bluefish access. How would I do that?
 
Old 11-13-2021, 09:46 PM   #5
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 22.04
Posts: 2,125

Original Poster
Rep: Reputation: 73
@ondoho

These instructions for sshfs are from digitalocean.com

Quote:
To start we will need to create a local directory in which to mount the droplet’s file system.

sudo mkdir /mnt/droplet <--replace "droplet" whatever you prefer
Could I just create a directory in my home folder? Does this have to be sudo?
 
Old 11-13-2021, 10:14 PM   #6
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 22.04
Posts: 2,125

Original Poster
Rep: Reputation: 73
I installed sshfs, then I tried:

Quote:
pedro@pedro-HP:~$ sudo mkdir -v /mnt/mywebpage.com
[sudo] password for pedro:
mkdir: created directory '/mnt/mywebpage.com'
pedro@pedro-HP:~$ sudo sshfs -o allow_other,default_permissions pedro@123.456.789.123:/ /mnt/mywebpage.com
read: Connection reset by peer
pedro@pedro-HP:~$ sudo sshfs -o allow_other,default_permissions,IdentityFile=/home/pedro/.ssh/my_cloud_ed25519 pedro@123.456.789.123:/ /mnt/mywebpage.com
read: Connection reset by peer
What can I do about "Connection reset by peer"??

I can access the cloud server easily through normal ssh:

Quote:
pedro@pedro-HP:~$ ssh -p 22000 -i ~/.ssh/my_cloud_ed25519 pedro@123.456.789.123
pedro@123.456.789.123's password:
 
Old 11-14-2021, 01:23 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
No, you don't need sudo, you can use a dir under your $HOME.

Quote:
Code:
sudo sshfs -o allow_other,default_permissions pedro@123.456.789.123:/ /mnt/mywebpage.com
don't use sudo with sshfs (or ssh)!
Also that command differs significantly from your normal ssh login:
Quote:
Code:
$ ssh -p 22000 -i ~/.ssh/my_cloud_ed25519 pedro@123.456.789.123
a) you're trying to access the root folder /. That's wrong. You probably want your remote $HOME (make a symlink to /var/www in your remote $HOME).
b) you need to specify the port if it isn't 22.

I also wonder why you use an identity file yet it still asks for your password. But that's a separate problem.
 
Old 11-15-2021, 01:23 AM   #8
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 22.04
Posts: 2,125

Original Poster
Rep: Reputation: 73
Thanks for your reply again.

As far as I understand it, this: pedro@123.456.789.123:22000/ should get me to the $_SERVER['DOCUMENT_ROOT'], which is public_html.

The port for this server is 22000

I tried using the port number in the command. The first time it asked for my password, but still gets: "read: Connection reset by peer"

Repeated attempts just give: "read: Connection reset by peer"

I tried this:

Quote:
pedro@pedro-HP:~$ sshfs -o allow_other,default_permissions,IdentityFile=/home/pedro/.ssh/my_cloud_ed25519 pedro@123.456.789.123:22000/ /mnt/mywebpage.com
fusermount: user has no write access to mountpoint /mnt/mywebpage.com
So made a folder in my home directory: mywebpage.com

Quote:
pedro@pedro-HP:~$ sshfs -o allow_other,default_permissions,IdentityFile=/home/pedro/.ssh/my_cloud_ed25519 pedro@123.456.789.123:22000/ /home/pedro/mywebpage.com
fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf
Tried again without "allow_other"

Quote:
pedro@pedro-HP:~$ sshfs -o default_permissions,IdentityFile=/home/pedro/.ssh/my_cloud_ed25519 pedro@123.456.789.123:22000/ /home/pedro/mywebpage.com
Still get "read: Connection reset by peer"

Maybe there is some setting on the server that needs adjusting??
 
Old 11-15-2021, 01:56 AM   #9
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,383
Blog Entries: 3

Rep: Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774
You need the -p option for the port.

Code:
sshfs -p 22000 -o default_permissions,IdentityFile=/home/pedro/.ssh/my_cloud_ed25519 pedro@123.456.789.123:/var/www/public_html /home/pedro/mywebpage.com
Also the mount point needs to be writable. If it's just you doing the writing then just change the ownership of the mount point.
 
1 members found this post helpful.
Old 11-16-2021, 05:27 PM   #10
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 22.04
Posts: 2,125

Original Poster
Rep: Reputation: 73
Thanks very much!

Worked perfectly!!

Well, I had to add a little to get to the right folder:

Quote:
sshfs -p 22000 -o default_permissions,IdentityFile=/home/pedro/.ssh/my_cloud_ed25519 pedro@123.456.789.123:/var/www/mywebpage.com/public_html /home/pedro/mywebpage.com
Now I will try editing as usual in Bluefish!

One more small thing: how to I unmount this sshfs? I won't need it open all the time!

Last edited by Pedroski; 11-16-2021 at 05:33 PM.
 
Old 11-16-2021, 11:48 PM   #11
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,383
Blog Entries: 3

Rep: Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774Reputation: 3774
You can unmount it either way:

Code:
umount /path/to/mount/point

fusermount -u /path/to/mount/point
Note there is only one 'n' in umount. The second option is also available because sshfs uses the FUSE (Filesystem in Userspace) kernel module.

As usual, be sure to at least skim the manual pages for each of these tools so that they become more familiar:

Code:
man sshfs
man umount
man fusermount
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SED Multiline edit -- Quit After First Match/Edit RandyTech Linux - Newbie 9 06-09-2014 03:15 AM
Cannot edit blog comment from Android… edit box freezes as it is starting Kenny_Strawn LQ Suggestions & Feedback 3 01-05-2011 06:26 PM
Edit index.html file of apache web server sanketpatel.86 Linux - Software 3 08-17-2010 12:34 AM
Unable to change/edit html files in new Ubuntu 9.04 / Apache server murphy-o Linux - Newbie 4 10-21-2009 11:18 PM
help to edit Edit my bootloader's config file from kernel prompt jagdishpandey Linux - Kernel 5 07-03-2007 06:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration