Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
You just need to put your ssh key from the MacBook in the authorized_keys file on each of the target hosts. Each target should have separate setups so the "pair" is the combination of the target and your MacBook so is already different (so long as you didn't copy keys between hosts - sometimes you do that if you're doing something like clustering).
Note that the keys are per user on your MacBook so one way you could separate out what you're doing on each target is to setup multiple users on the MacBook that you su to before pushing via sftp.
e.g. su - vpsftpuser then sftp vps...
su - client1user then sftp client1...
su - client2user then sftp client2...
You could instead setup a menu that aliases sftp to go to specific targets when you use it so that you pick the client before you execute sftp and execution of sftp already has the client selected via the alias.
There's probably dozens of ways to do this.
However, the fact this MIGHT be a problem is a good reason to insure you are doing backups on all the systems regularly. No matter how well you plan the chances of a fat finger aren't completely eliminated not to mention the idea that the hardware or OS might fall over and die even if you weren't doing anything.
Unfortunately I was too busy (and dumb) to type up what I did earlier this year for my VPS.
What I recall is that I generated a public/private key pair on my Mac, and then I used the upload feature in cPanel on my VPS to upload the Public Key to my VPS.
On my Mac in .ssh, I have: id_rsa, id_rsa.pub, and known-hosts.
According to my web host, for a shared plan I have to create the key-pair using cPanel. And that would likely create the files: id_rsa and id_rsa.pub. So then I would have to copy the id_rsa to my MacBook, and that would overwrite the same file with the Private Key for my VPS.
You need to copy the contents of id_rsa.pub to the file authorized_keys on every server that you want to SSH in to. You can have several keys in that file, just start it on a new line.
See if your VPS allows you to upload a public key.
If, on the other hand, each server truly does require you to log in with a special private key, you can simply use the -i flag in ssh to send a unique private key to each server. If you want it automated, just stick it in .ssh/config with "IdentityFile", eg: http://nerderati.com/2011/03/17/simp...h-config-file/