No such file or directroy

DBD

New Member
Joined
Jul 6, 2023
Messages
6
Reaction score
0
Credits
50
I am using Windows where I have downloaded MobaXterm and in the terminal I am writing a script trying to access an EC2 instance

Now, I have downloaded the .pem file (key value pair) and kept it in a folder in (D) drive

When I am writing this

 10/06/2023   13:46.43   /home/mobaxterm  ssh -i D:\Cloud\DevOps\aws_key_val\testmd.pem [email protected] Warning: Identity file D:\Cloud\DevOps\aws_key_val\testmd.pem not accessible: No such file or directory.
[email protected]: Permission denied (publickey)

Permission denied part I have got it but why the system is telling me NO SUCH FILE OR DIRECTORY ????

Where am I doing the mistake (Is it with slashes like forward-backward, is it with that the name cannot start with D:.....Any idea??
 


Welcome to the forums.

Both things could be wrong with the filename: the drive specification, and the slashes. Linux doesn't believe in "drive letters" like Windows does. For Windows it shouldn't matter very much "which" slash but generally it's the ASCII92 figure. For Linux it's the ASCII47 figure.

You will have to figure out the volume label for that "D: drive" and then set it as

Code:
/media/(user)/(volumelabel)

where "(user)" is the name of your regular user's account, and "(volumelabel)" is the name of the drive that you're having the problem with.

This is assuming you're on Linux. Otherwise trying to run Linux stuff in Windows could lead to interesting things. Are you using a virtual machine?
 
One mistake is to post to this forum? This is Linux.org. We use Linux, not Windows.

Why not post to a forum which supports Windows?
I understand but the commands are all linux related that is why I posted here
 
I understand but the commands are all linux related that is why I posted here
You are on Windows not Linux and MobaXterm is not equal to running native Linux. Windows paths use back slashes not forward slashes, try changing the slashes from forward slashes to back slashes since you are on Windows.
 
You are on Windows not Linux and MobaXterm is not equal to running native Linux. Windows paths use back slashes not forward slashes, try changing the slashes from forward slashes to back slashes since you are on Windows.
I am giving backslashes only (\) but still the same error is coming
 
  • Like
Reactions: DBD
I am giving backslashes only (\) but still the same error is coming
Change to the directory and display the path you have and then use that and also check that you actually have permissions on that file and the path to that file.
 
  • Like
Reactions: DBD
 
It kind of looks like MobaXterm handles Windows paths differently, find out what your home directory is under MobaXterm and copy that pem file there.
 
Change to the directory and display the path you have and then use that and also check that you actually have permissions on that file and the path to that file.
What I doing I will try to show

IMG_20230706_162049_423.jpg
help 1.PNG
 
@DBD - If you're running UNIX style commands in an Unix-like environment - it won't accept Windows style paths like D:\Users\Somebody\whatever.txt.
It will be expecting paths to be in UNIX format. e.g. /path/to/whatever.txt.

It expects paths from the root of the file-system, or /.
I've never used MobaXterm, so I don't know how it's set up. But I do use Cygwin on Windows at work.

So for example - when using Cygwin on Windows, if I want to pass a command (e.g. vim) a path to a file which is somewhere in my Windows home directory (instead of my Cygwin home directory), then I'd use the following:
Bash:
vim /cygdrive/c/Users/Jason/Documents/someFile.txt

In Cygwin, it sets up a UNIX-like file-system. To access my Windows C:\ from root, I have to navigate to /cygdrive/ - which is where all of the other drives will appear.
Again, I've never used MobaXTerm, so I don't know what kind of environment that sets up. But I would imagine that your path to your D drive will be somewhere off root /.

So in MobaXterm, I'd recommend exploring your file-system from / and see if you can work out the path to your D:\.
Another option would be to try running:
updatedb, or sudo updatedb (if required)
This will take some time, but it will create a database of files on all drives on your system.
Once that command has finished - run the command locate testsd.pem and it will immediately tell you the path to the .pem file you're looking for. Assuming that you don't have more than one file called testsd.pem - in which case, it will list all of them!
Either way - you should be able to see the correct path to use, in order to access your file from MobaXterm...
 
I installed Windows in a vm and MobaXterm, you will have to use the following path.
Code:
ssh -i /drive/d/Cloud/DevOps/aws_key_val/testmd.pem
You could have easily figured out this yourself by trying it.
 
I moved this to General Computing as this is a Windows question.

I'd have normally just closed the thread, but folks are legitimately trying to help OP.

It could get moved again, but this seems the most appropriate sub-forum. It'd also work in 'off topic', for example.
 

Members online


Latest posts

Top