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]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux