LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-26-2008, 12:35 PM   #1
nomikos
LQ Newbie
 
Registered: Nov 2008
Location: Concepción, Chile
Distribution: Centos 5.5 (server) / Zenwalk; Linux Mint (desktop)
Posts: 29

Rep: Reputation: 4
Question midnight commander ssh over unusual port


Hi

I'm trying to connect via ssh to my remote server using mc this way:

cd /#sh:user@server

but I only receive ssh connections over port != 22 (iptables)

Q1.- after googling I realized that is not a port option to do this. It's that correct?

Q2.- (less important) how execute sudo on the remote server using mc?

TIA.-
 
Old 12-01-2008, 12:12 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by nomikos View Post
after googling I realized that is not a port option to do this. It's that correct?
AFAIK there's no port option in mc's FISH. Maybe you could set up a SSH tunnel outside of mc and use that?


Quote:
Originally Posted by nomikos View Post
(less important) how execute sudo on the remote server using mc?
Using mc I wouldn't know. It clearly says "can't run commands on nonlocal filesystems".
 
Old 12-01-2008, 11:32 PM   #3
nomikos
LQ Newbie
 
Registered: Nov 2008
Location: Concepción, Chile
Distribution: Centos 5.5 (server) / Zenwalk; Linux Mint (desktop)
Posts: 29

Original Poster
Rep: Reputation: 4
thanks unSpawn
 
Old 11-09-2010, 01:36 AM   #4
yeugeniuss
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Rep: Reputation: 0
Wink

As I know mc could not use specific port, but you can cheat it. It is Linux, isn't it?

As mc uses system ssh, you need to work with ssh, not with mc.
Go to /home/user/.ssh/ and create there file "config" if not existed. Then write there specific section for each host you work with regulary:

host vistafail
user root
hostname vistaepicfail.microsoft.com
port 6666

Now you could connect to host
[user@localhost]#ssh vistafail
ssh will do other work - ssh root@vistaepicfail.microsoft.com -p 6666, the same in mc - open shell link and enter "vistafail"

I am not sure if such host existed, but method works

Last edited by yeugeniuss; 11-09-2010 at 01:40 AM.
 
Old 11-09-2010, 11:20 PM   #5
nomikos
LQ Newbie
 
Registered: Nov 2008
Location: Concepción, Chile
Distribution: Centos 5.5 (server) / Zenwalk; Linux Mint (desktop)
Posts: 29

Original Poster
Rep: Reputation: 4
so time ago! your solution is great.

since the most of the time I work with ftp accounts of clients I use .netrc for automatic login:

Code:
$ cat ~/.netrc 
machine my_hostname login my_user password my_password
...
...
but only works for ftp (from inside mc too). I'll try your suggestion for my own VPS.
thank very much yeugeniuss!

nomikos.-

Last edited by nomikos; 11-09-2010 at 11:22 PM.
 
Old 02-13-2011, 06:06 PM   #6
nomikos
LQ Newbie
 
Registered: Nov 2008
Location: Concepción, Chile
Distribution: Centos 5.5 (server) / Zenwalk; Linux Mint (desktop)
Posts: 29

Original Poster
Rep: Reputation: 4
Red face Update

Happy to say that at this time, midnight commander already have port specific support.
In shell link enter data in this format:

Code:
user@machine:port
 
  


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
Midnight Commander graphics under WinXP SSH tatacalu Linux - Software 5 05-21-2008 02:55 PM
Midnight Commander matombo Fedora 3 11-30-2005 12:41 PM
Midnight Commander - SSH trames Linux - Software 1 04-06-2004 08:56 PM
Midnight Commander XPediTioN Slackware 2 07-12-2003 11:45 PM
Where's mc (Midnight Commander) Shadow Of Death Linux - Software 7 01-09-2003 07:09 PM

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

All times are GMT -5. The time now is 07:46 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