Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Saturday, November 26, 2016

Text editor that can edit using sudo over ssh?

Text editor that can edit using sudo over ssh?


I'm trying to edit files on a remote Amazon EC2 Linux instance. I'm currently just sshing in and using nano, but would really like a graphical text editor. I have two problems:

  1. I have to use sudo to edit these server files when I ssh in.
  2. I can only login with the key Amazon gave me. Ex: ssh -i Andrew.pem ec2-user@55.55.44.33

Please help! I'm not picky, just any graphical text editor since using nano is a huge pain.

Answer by Bijendra for Text editor that can edit using sudo over ssh?


would really like a graphical text editor  

You cannot have a graphic editor, you need to use any editors like nano as you said or vim,emacs. Sudo would be required when you have to edit configuration files with root as owner.

Answer by maahd for Text editor that can edit using sudo over ssh?


Sudo is for root privileges for that particular command. You will need to use root privileges to edit system files. Even on a local machine. If you don't like typing sudo every time, you can type sudo -s. You will change to root user and it will show you in terminal i.e. root@ip.... The $ sign will also change to #. Honestly, I prefer not going root, because it is easier to make irreversible mistakes with root privileges. I've made some mistakes and I'm talking from experience...

As far as the second part of your question goes, you can configure various text editors to sftp into your instance such as sublime.

You will have to use the .pem key file every time you ssh using terminal. This is because AWS takes security very seriously. You can put the key file in your home directory. That way you don't have to change directories every time you open up terminal.

You can also edit a local copy of files and then use FileZilla to transfer. Setting up FileZilla to work with your EC2 instance is straightforward. You can give vim a try since it colors your code and is more advanced than nano. Use the command vi or vim from terminal.

Happy SSH'ing ;).

Answer by ronpatel for Text editor that can edit using sudo over ssh?


ssh -X user@server.   

You have to make appropriate setting for forwarding.

Answer by Rquinter for Text editor that can edit using sudo over ssh?


I use SFTP Net Drive SFTP, which let you create a virtual drive on your local computer that will map the remote file system accessible via SFTP protocol. After the map is created, you can use the editor of your preference.

Answer by Ryan for Text editor that can edit using sudo over ssh?


Just modify the appropriate files on your local machine and scp the file into the remote machine.

scp  remoteUser@remoteHostName:  

Answer by Lee Marshall for Text editor that can edit using sudo over ssh?


For this, i'd suggest one of:

  1. Learn and use emacs; it's quite powerful as far as textmode editors go.

  2. Install your favourite graphical editor on the server and use X forwarding, 'ssh -X server.com'. This will allow you to launch the editor remotely, but have it display locally.

  3. Most elegant in my opinion, use sshfs (https://github.com/libfuse/sshfs) to mount the remote directory locally, so you can work on the files directly using your favourite text editor.

Answer by user2970934 for Text editor that can edit using sudo over ssh?


You can use nano, vim, vi or many others. However if you want to edit with a graphical text editor you will have to create SFTP since Amazon does not support FTP. One way is to use filezilla to upload your files. Here is a video on using filezilla https://www.youtube.com/watch?v=VawBMj29g0o I suggest SSH though. Its fast and easy here is a video on that https://www.youtube.com/watch?v=O2-3HoRjBH4


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.