Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You don't need to use the ssh-copy-id program if your physically at the server.
Code:
cat id_rsa.pub >> ~/.ssh/authorized_keys
Replace the name of the public key filename if different.
ssh-copy-id program basically logs into the server and then appends the public key to authorized_keys file. The cat command does the same thing but you do not need ssh.
You don't need to use the ssh-copy-id program if your physically at the server.
Code:
cat id_rsa.pub >> ~/.ssh/authorized_keys
Replace the name of the public key filename if different.
ssh-copy-id program basically logs into the server and then appends the public key to authorized_keys file. The cat command does the same thing but you do not need ssh.
grrr... i had thought of this (i saw that the "id_rsa.pub" file only contained the encryption code) and then between jobs and tasks i totally forgot.
I guess you never stop learning from mistakes.
Thank you.
p.s.: i think i will test the ssh connection between box A and B tomorrow and let you know
Just a quick THANK YOU note, on the config file trick!
it works great now, after the correction and i can ssh box C directly by using just the host name (much easier/simpler that having to type the IP every time).
Question: can i have a config file that looks like this?
Yes, make sure you specify the correct private key for each host if different.
Don't forget to forward the port on your work router to you work computer ip address. You have never posted your work network hardware or maybe you have an IT employee that can do it for you.
If you don't have a static work ip address you can sign up for a free dynamic dns service that will provide a url that always resolves to your ip address.
make sure you specify the correct private key for each host if different.
done
Quote:
Don't forget to forward the port on your work router to you work computer ip address.
done
Quote:
You have never posted your work network hardware or maybe you have an IT employee that can do it for you.
Network hardware? not sure what i should post: card type? name? (no IT employee) - It just an old desktop running slackware 14.1 (so old that it doesnt have a network card; I use a wireless USB)
Quote:
If you don't have a static work ip address you can sign up for a free dynamic dns service that will provide a url that always resolves to your IP address.
is this safe? would it not be safer to ask for a static IP address to my ISP?
As far as I know it isn't less safe. There will still be people scanning IP addresses including yours looking for vulnerabilities and ssh servers trying to break in using common usernames and passwords which is why disabling password authentication is important.
I have commented out "# PasswordAuthentication" for testing ssh on localhost and it gets connected OK. However, if i uncomment "PasswordAuthentication" it gives me the same error msg when i try to connect to localhost
beside any issues with the keys, should i not be able to connect to localhost though?
Code:
bash-4.2$ ssh -v localhost
OpenSSH_6.3, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/darkstar/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/darkstar/.ssh/id_rsa type 1
debug1: identity file /home/darkstar/.ssh/id_rsa-cert type -1
debug1: identity file /home/darkstar/.ssh/id_dsa type -1
debug1: identity file /home/darkstar/.ssh/id_dsa-cert type -1
debug1: identity file /home/darkstar/.ssh/id_ecdsa type -1
debug1: identity file /home/darkstar/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.3
debug1: match: OpenSSH_6.3 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 8b:ae:92:a9:ec:8e:d9:ce:4d:20:e0:cf:6f:b6:78:f7
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /home/darkstar/.ssh/known_hosts:3
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/darkstar/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /home/darkstar/.ssh/id_dsa
debug1: Trying private key: /home/darkstar/.ssh/id_ecdsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: No more authentication methods to try.
Permission denied (publickey,keyboard-interactive).
bash-4.2$
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.