Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 6812  / 1 Year ago, thu, december 8, 2022, 9:40:47

I'm trying to connect to Ubuntu via SSH from OS X, and I took the same step as explained in this page (https://help.ubuntu.com/10.04/serverguide/openssh-server.html). After setting it, I tried to connect by the form of username@ip_address, then it was successful and I was able to be in Ubuntu from OS X Terminal (this time I used port 22). However, when I tried to SSH to Ubuntu by the form of username@hostname, then I couldn't and the error ssh: Could not resolve hostname my_user_name: nodename nor servname provided, or not known occurred. I also tried to connect via port 2222 by changing /etc/ssh/sshd_config, then it failed too by spitting out the error debug1: connect to address my_ip_address port 22: Connection refused (this time I tried to connect by IP address).



So I think the latter issue stems from the fact that I have to make some sort of modifications also on OS X, but don't know where/how to do and don't know it's true in the first place.



The former issue is more annoying, as I'm not sure whether I could understand it correctly. I used hostname as the value that I got from running hostname on Ubuntu Terminal...but is it right? And when I searched for the issue on the Web, I knew that it's from DNS issue...but don't know what it is and how to fix it...



Thanks.


More From » server

 Answers
2

In Terminal on OS X when using ssh to establish a remote connection using a hostname on a local network, add the suffix .local such that the command reads ssh [email protected] If you need to override the default port 22, as your example of using port 2222, add -p 2222 to the command. You can also set this up in Terminal's "New Remote Connection.." dialog (Command-Shift-K) for easy access.


[#30425] Saturday, December 10, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hentor

Total Points: 482
Total Questions: 104
Total Answers: 111

Location: South Korea
Member since Sun, Dec 25, 2022
1 Year ago
;