LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-25-2012, 10:16 AM   #1
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
vim over ssh


Hi

I am trying to use vim over ssh, here is what I have tried
Code:
vim ssh//user@local-ip//home/user/file
also vim sftp, and vim scp all with -p switch (as different port number)

I have also tried from within vim
Code:
:e sftp://user@ip/home/user/file
Dose any one know of how to get this to work.
 
Old 08-25-2012, 12:12 PM   #2
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Rep: Reputation: 38
You've tried this, right?

Alex Brinister
 
Old 08-25-2012, 12:35 PM   #3
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

Ok that got me through although I had to play with port number, where to put it, and had to change a part in the command someremotehostort-number/./path/to/file to someremotehostort//path/to/file

I did see this tutorial I think the placing of the port number messed it up.
Thks for your help.
 
Old 08-25-2012, 12:43 PM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
I would also like to know if it possible and how to edit files using vim over ssh as root example /etc/fstab etc. This may not be an option tho.
 
Old 08-25-2012, 12:49 PM   #5
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Rep: Reputation: 38
Can't one just make the username 'root'?

Like so?

Code:
:e scp://root@someremotehost//etc/fstab
Alex Brinister
 
Old 08-25-2012, 12:49 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,995

Rep: Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682
If you are using a different port the syntax is:
Code:
vim scp://user@server:port#//path/to/file
A bit late...

Typically by default root login via ssh is disabled and not recommended for security reasons.

Last edited by michaelk; 08-25-2012 at 12:51 PM.
 
Old 08-25-2012, 12:54 PM   #7
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

michaelk you are correct just found that googling, So for all intense and purpose vim dose do what I want editing root files was just an expansion on use, thks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
vim freeze at startup when in ssh session sylye Slackware 7 04-03-2011 07:08 AM
question about VI/VIM and ssh via putty Lleb_KCir Linux - Software 6 06-25-2009 08:03 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 05:26 PM
VIM via remote SSH connection causes seg fault nkendrick Linux - Software 1 11-08-2003 07:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:06 AM.

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