Score:0

how do I move a pem file which is downloaded to Windows 10 and move it to root@Ubuntu?

ky flag

There is a pem key from AWS that is downloaded to my Windows 10. The Jenkins and Nginx is installed using Ubuntu 20.04 LTS (WSL2) at Root.

Now, in order for all to work together, I need to bring this pem key which is in Windows 10 to Ubuntu Root. How do I make that happen?

Alternatively, I "could" regenerate a pem key from AWS and make it saved in Ubuntu or downloaded to Ubuntu instead of Windows 10. How to make that happen?

guiverc avatar
cn flag
You mention 20.04 is your question, but have tagged your release as being 12.04/precise - why? Please clarify which you're on & how the two releases relate?
Score:0
hu flag

I guess you are using WSL ?

You can access your windows files under this directory

cd /mnt/c/Users/<ubuntu.username>/Downloads

Then you can copy it to your directory and then change permissions

ky flag
i did what you say root@DESKTOP-SB41UI7:~# cd /mnt/c/Users/<ubuntu.root>/Downloads -bash: ubuntu.root: No such file or directory
Score:0
cn flag

Your drive can be accessed from the /mnt/ directory in WSL. With that said if you can simply navigate to /mnt/c/Users/{windows.user}/Downloads/ - replacing {windows.user} with your exact windows username, you'll be able to see all downloads that have been downloaded in windows. Think of the directory of /mnt/c as a shortcut to the C: drive directory.

So in order to copy a file from windows to say the home directory of the current WSL user, you can use either the cp (copy) or the mv (move) commands like so:

# say the windows user name is Saleem for this example
$ cp /mnt/c/Users/Saleem/Downloads/aws.pem ~/aws.pem

# to move a file (cut/paste)
$ mv /mnt/c/Users/Saleem/Downloads/aws.pem ~/aws.pem

The syntax for cp is cp [options] SOURCE DEST, and for mv is mv [options] SOURCE DEST

the [options] argument is optional. as long as you are dealing with files its the same syntax, but for directories, you'd pass -R or -r (recurse through directories) option to cp, while mv just works for both files and directories without any extra options.

To learn more about usage of linux commands use man {command}, this will display the man pages of the command in question, which is a documentation for usage/features for the command.

ky flag
It doesn't work. Here's what I did : https://pastebin.com/9EAY9KZn
SaleemKhair avatar
cn flag
Your syntax is incorrect its `cp SOURCE DEST` there is no `//` after cp , if the folder path has spaces surround the path with `"`
SaleemKhair avatar
cn flag
Why is there a `/to/` ?
SaleemKhair avatar
cn flag
`cp` **space** `"/mnt/c/Users/karen/Udacity And SUSE Cloud Native/AWS-Jenkin-Practice/jenkins-master.pem.txt/to/Users/root/jenkins-master.pem"` **space** `~/ssh/jenkins-master.pem.txt` --> assuming master.pem.txt is a folder
ky flag
hi @SaleemKhair, how do i create a folder ssh jenkins-master is a pem file but I do not know why when I use locate pem it indicate a .txt behind
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.