Re: Restricting ssh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Thu, Jan 6, 2011 at 15:45, Sam Varshavchik <mrsam@xxxxxxxxxxxxxxx> wrote:
Timothy Murphy writes:

I have an sshd server running on a machine in Ireland.

Can I configure it so that it only accepts connection
from certain machines, wherever they may be in the world?

In sshd_config set:

PasswordAuthentication no

Then, on the machines that you wish to allow connections from, in each account you wish to connect, run ssh-keygen to generate a keypair. This will create id_rsa and id_rsa.pub (or id_dsa and id_dsa.pub) in $HOME/.ssh (with permissions set appropriately), then append the contents of id_rsa.pub or id_dsa.pub to the $HOME/.ssh/authorized_keys2 file on the server that you want to connect TO.



There are ssh commands that make that process even easier...
Once you have your public/private key pair...

eval $(ssh-agent)
ssh-add
ssh-copy-id <remote system>

You'll be prompted for the password at the remote system so it can copy the keys across, if that's successful, you won't need the password anymore.

I added these to my ~/.bash_profile
eval $(ssh-agent)
ssh-add

I get prompted once for my ssh key passphrase and after that I don't get prompted for password anymore for the systems I ssh to.
(You can also not use an ssh key passphrase but I'm not quite that paranoia-free. :-)



-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux