LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-05-2023, 12:56 AM   #1
LT72884
Member
 
Registered: Jul 2012
Posts: 151
Blog Entries: 1

Rep: Reputation: Disabled
ssh Could not resolve hostname


Ok, i generated some ecdsa keys from the ubuntu client. I have imported the key to my windows ssh server and file zilla connects from ubuntu so i know i have connectivity.

Now, when i use the command line

ssh user@x.x.x.x:xxxx

Could not resolve hostname x.x.x.x:xxxx Name or service not known

i have no idea what to do next

thanks
 
Old 01-05-2023, 02:33 AM   #2
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
That's because you are specifying the port along with the IP address together (x.x.x.x:xxxx). You need to specify the port using the -p port when using the command line. From the man page:

Code:
     -p port
             Port to connect to on the remote host.  This can be specified on a per-host basis in the configuration file.
So if I wanted to connect to 12.12.123.12 at port 56 the command would look like:

Code:
ssh -p 56 user@12.12.123.12
 
Old 01-05-2023, 02:41 AM   #3
LT72884
Member
 
Registered: Jul 2012
Posts: 151

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by suramya View Post
That's because you are specifying the port along with the IP address together (x.x.x.x:xxxx). You need to specify the port using the -p port when using the command line. From the man page:

Code:
     -p port
             Port to connect to on the remote host.  This can be specified on a per-host basis in the configuration file.
So if I wanted to connect to 12.12.123.12 at port 56 the command would look like:

Code:
ssh -p 56 user@12.12.123.12
ohhhhhhhhh. ok, let me try again in the morning. im super tired right now haha
 
Old 01-05-2023, 03:39 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,295
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
Quote:
Originally Posted by suramya View Post
That's because you are specifying the port along with the IP address together (x.x.x.x:xxxx).
When using that format, you need to also include the protocol:

Code:
ssh ssh://203.0.113.184:22

# or

sftp sftp://192.0.2.124:22/home/me/Documents/
That possibility has been around since OpenSSH 7.7
 
Old 01-05-2023, 08:33 PM   #5
LT72884
Member
 
Registered: Jul 2012
Posts: 151

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
When using that format, you need to also include the protocol:

Code:
ssh ssh://203.0.113.184:22

# or

sftp sftp://192.0.2.124:22/home/me/Documents/
That possibility has been around since OpenSSH 7.7
ok, i knew i was close to the correct syntax. I forgot about the -P option and the sftp://x.x.x.x:xx

ill give it a try and see what happens
 
Old 01-05-2023, 09:22 PM   #6
LT72884
Member
 
Registered: Jul 2012
Posts: 151

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Ok, i FINALLY got it to work. I can now ssh into my windows server via CLI from my ubuntu client. FINAL issue i need to resolve. When i click on the home folder of my ubuntu client, and i click "other locations" on the left hand side, i then type sftp://x.x.x.x:xxxx and i get a permission denied. How do i use this other connections box to conect via sftp using the username for the account?

thanks
 
Old 01-06-2023, 02:44 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
You can use a ssh config file (~/.ssh/config)
Host myhost
HostName x.x.x.x
User name
Port xxxx
IdentityFile ~/.ssh/your_ecdsa.key


https://linuxize.com/post/using-the-ssh-config-file/

In your file browser use sftp://myhost
From the cli use ssh myhost
 
Old 01-06-2023, 12:42 PM   #8
LT72884
Member
 
Registered: Jul 2012
Posts: 151

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
ok, thanks guys. I got the file manager to connect. I had wrong syntax again hahaha. sftp://user@IPort is what i needed. Once i did this, it all connected just fine.

now onto the next project, syncthing, duplicacy, and rclone
 
Old 02-01-2023, 04:04 PM   #9
xlfs-0.2
Member
 
Registered: Oct 2022
Posts: 207

Rep: Reputation: 44
rsh $RHOST -l $XUSER "$*"

if you don't have rsh ask yourself why it's been removed and replaced with BLOAT. it's built for raw speed, nearly an RPC (network mainframing) speed. it can be secured using vpn if outside-of-lan shell is needed.
 
Old 02-01-2023, 05:54 PM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by xlfs-0.2 View Post
rsh $RHOST -l $XUSER "$*"

if you don't have rsh ask yourself why it's been removed and replaced with BLOAT. it's built for raw speed, nearly an RPC (network mainframing) speed. it can be secured using vpn if outside-of-lan shell is needed.
Sorry, no...it's been replaced because it is incredibly insecure, and if you can tell from a terminal which commands are a millisecond faster, good luck. It's plain bad, needs ports opened that otherwise do NOT need to be opened, and can be brute-forced easily.
https://en.wikipedia.org/wiki/Remote_Shell
 
Old 02-02-2023, 07:44 AM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
car020 your spam post/link has been reported.
 
Old 02-02-2023, 02:10 PM   #12
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by xlfs-0.2 View Post
rsh $RHOST -l $XUSER "$*"

if you don't have rsh ask yourself why it's been removed and replaced with BLOAT. it's built for raw speed, nearly an RPC (network mainframing) speed. it can be secured using vpn if outside-of-lan shell is needed.
rsh is one of the most insecure means to connect to a remote system. Every byte that travels between the two systems (including the username & password) is sent in cleartext and is vulnerable to MITM (Man in the middle) and sniffing attacks. Suggesting that you can secure it by putting a VPN for out of lan connections ignores the possibility of insider threat or even the fact that an attacker could have breached the network firewall and is listening to the network traffic to steal your secrets & data. Running RSH is like leaving your house keys under the welcome mat.

You are assuming that your attacker will be stopped at the shell (or outskirts) of your network and that is all you need to secure your systems, this is the coconut way of securing (hard shell on the outside, with open access once you are in) but is not a secure setup at all.
 
  


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
Could not resolve hostname <server name>: Name or service not known Messed_Up_Linux Linux - Server 2 12-28-2020 06:19 AM
ssh- could not resolve hostname xunilresu17 Linux - Networking 3 06-07-2018 11:31 AM
New to LQ. ssh: Could not resolve hostname... svesmeralda LinuxQuestions.org Member Intro 7 08-09-2015 04:23 AM
How I can resolve the error Postfix? warning: hostname does not resolve to address kanzer Linux - Server 1 03-22-2013 08:56 AM
SSH Troubles: ssh: Could not resolve hostname: Name or service not known -Xubuntu12 reklaimer Linux - Networking 4 06-03-2012 02:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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