ssh: Could not resolve hostname : Name or service not known on scp command
The error message "ssh: Could not resolve hostname: Name or service not known" typically occurs when the hostname provided in the scp command cannot be resolved. This means that the system is unable to find the IP address associated with the hostname specified.
To resolve this issue, you can take the following steps:
Check the hostname: Ensure that the hostname you are using is correct and properly formatted. Double-check for any typos or misspellings. It's also important to ensure that the hostname is reachable from the system where you are running the scp command.
Check the DNS resolution: Verify that the DNS resolution is working correctly on your system. You can do this by using the "ping" command followed by the hostname. If the ping is successful, it means that the hostname is being resolved correctly. If not, you may need to troubleshoot your DNS configuration.
Check the /etc/hosts file: If you are using a local hostname that is not resolved through DNS, make sure that the hostname is correctly defined in the "/etc/hosts" file. Open the file using a text editor and ensure that the hostname is mapped to the correct IP address.
Check the network connectivity: Make sure that you have a working network connection and that you can reach the destination system. You can try pinging the IP address of the destination system to verify connectivity.
Check the firewall settings: If you are running a firewall on either the source or destination system, make sure that it is configured to allow the necessary SSH traffic.
By following these steps, you should be able to resolve the "ssh: Could not resolve hostname: Name or service not known" error and successfully use the scp command.