(01-31-2018, 05:48 AM)CMs222 Wrote: using this guide > https://devops.profitbricks.com/tutorial...n-windows/
Create New Public and Private Keys:
number 4. when saving private key, it prompted me to add a passphrase (should I ?) as its not mentioned in guide...
Copy Public Key to Server:
got to number 3. and when i went to safe got error
[ Error writing /home/*******/.ssh/authorized_keys: No such file or directory ]
So i'm stumped again
Hypothetically, you should use a passphrase (password) for the certificate. The upside of not using one is that you don't have to type in a password for the key to work each time. I cannot recommend you NOT using a passphrase for your certificates, but can tell you I have done it both ways and find my laziness prevails and I don't use a passphrase. This is a compromise in security, but nowhere nearly as bad as using a username and password in plain text is. The web can tell you more about the absence of a passphrase and its vulnerabilities. Google that...
What happens in step three? Did you use vi to create (and edit) the authorized_keys file? Do you have vi installed on your Ubuntu install? It comes with CentOS. You should when you type:
Code:
vi ~/.ssh/authorized_keys
be creating and editing in the root folder because of the ~. What are you typing into bash for step 3? Your error tells me you are trying to make keys/certificates for a user other than root. The article's command will only work for root. You must have changed the vi command to your other user in the home folder.
Code:
Error writing /home/YOURUSERNAME/.ssh/authorized_keys: No such file or directory
Your error is because of the "~" in the command - it puts you into the /root folder which does not have a /home folder in it. The home folder is at the top level ("/")... You would need:
Code:
vi ~/../home/YOURUSERNAME/.ssh/authorized_keys
to work in the home folder.
Did you try?
Code:
sudo vi ~/../home/YOURUSERNAME/.ssh/authorized_keys
As per your past postings - wanting to be able to use WinSCP to modify and manipulate folders that have root privileges, you will need to make the key for the root user, otherwise you will run into the same issue as you have in the past with manipulating files in WinSCP.
Please outline what exactly you are doing and have done as it is not the same as that tutorial. I also save my keys to a folder called keys on my PC's C: drive at the top level. Then I use Pagent or Kagent that starts and loads the keys when I start windows to maintain the keys for when I use WinSCP, Filezilla, or mRemoteNG as a bash terminal so they simply log into the server on their own. No passphrase for the keys allows me to log in to my server with one click from these applications.
Can you post your work up to where you have problems? If you are using another user, put something like "otherusername" instead of ******. We need to know if you are:
A) Working as root user
B) Trying to create keys for *what* user - remember, to mitigate your issues with file permissions in WinSCP will take making keys for root.
Everyone makes mistakes, but to truly screw up it takes the root password!