Apple Intelligence is now available on iPhone, iPad, and Mac!

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Why can't I create a .ssh directory on macOS 10.15.4?

I'm running into a strange problem trying to set up ssh. I'm more used to Linux than macOS. Can someone explain to me what's going on here?


user@nothing ~ % mkdir ~/.ssh
mkdir: /Users/user: No such file or directory
user@nothing ~ % ls -ld ~
drwxr-xr-x+ 27 user  staff  864 Apr  1 13:49 /Users/user
user@nothing ~ % ls -ld ~/.ssh
ls: /Users/user/.ssh: No such file or directory


Similarly, I can't generate public and private keys:


user@nothing ~ % ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/user/.ssh/id_rsa): 
Could not create directory '/Users/user/.ssh': No such file or directory
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Saving key "/Users/user/.ssh/id_rsa" failed: No such file or directory


I can create a dot-prefixed directory with another name, no problem:


user@nothing ~ % mkdir ~/.abc
user@nothing ~ % 


If I do `mkdir /tmp/.ssh; mv /tmp/.ssh ~/`, the `mv` process hangs, and uses all my CPU until I restart!


So, how do I make my `.ssh` directory?

MacBook Air 13", macOS 10.15

Posted on Apr 1, 2020 2:23 PM

Reply

Similar questions

2 replies

Apr 2, 2020 8:03 AM in response to cooltoad57

cooltoad57 wrote:

I'm running into a strange problem trying to set up ssh. I'm more used to Linux than macOS. Can someone explain to me what's going on here?

user@nothing ~ % mkdir ~/.ssh
mkdir: /Users/user: No such file or directory
user@nothing ~ % ls -ld ~
drwxr-xr-x+ 27 user staff 864 Apr 1 13:49 /Users/user
user@nothing ~ % ls -ld ~/.ssh
ls: /Users/user/.ssh: No such file or directory

Similarly, I can't generate public and private keys:

user@nothing ~ % ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/user/.ssh/id_rsa):
Could not create directory '/Users/user/.ssh': No such file or directory
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Saving key "/Users/user/.ssh/id_rsa" failed: No such file or directory

I can create a dot-prefixed directory with another name, no problem:

user@nothing ~ % mkdir ~/.abc
user@nothing ~ %

If I do `mkdir /tmp/.ssh; mv /tmp/.ssh ~/`, the `mv` process hangs, and uses all my CPU until I restart!

So, how do I make my `.ssh` directory?



From the Finder>Go>Go to Folder, copy and paste:

~/.ssh



please advise...



Open the Terminal window on your MAC (by default you will be in ~/ dir) copy and paste:

 ls -la


This will list all the files & folder including hidden folders.


Apr 2, 2020 8:28 AM in response to leroydouglas

When I try to "Go to Folder": ~/.ssh in Finder, I get the message "The folder can't be found."


Here is the output of `ls -la`:


nnyby@nothing ~ % ls -la
total 104
drwxr-xr-x+ 28 nnyby staff  896 Apr 2 11:28 .
drwxr-xr-x  6 root  admin  192 Oct 23 20:37 ..
-r--------  1 nnyby staff   7 Mar 28 11:24 .CFUserTextEncoding
-rw-r--r--@ 1 nnyby staff 10244 Apr 2 11:23 .DS_Store
drwx------  2 nnyby staff   64 Apr 2 11:22 .Trash
-rw-------  1 nnyby staff  751 Apr 1 13:43 .bash_history
drwx------ 41 nnyby staff  1312 Nov 7 14:29 .bash_sessions
drwx------  3 nnyby staff   96 Nov 15 11:40 .config
drwxr-xr-x  4 nnyby staff  128 Nov 1 11:27 .emacs.d
-rw-r--r--  1 nnyby staff   53 Nov 13 12:28 .gitconfig
drwx------  3 nnyby staff   96 Nov 15 11:40 .local
-rw-------  1 nnyby staff  118 Mar 22 09:59 .python_history
-rw-------  1 nnyby staff 12554 Apr 1 19:37 .viminfo
-rw-------  1 nnyby staff  5838 Apr 2 11:23 .zsh_history
drwx------@ 3 nnyby staff   96 Apr 1 09:53 Applications
drwx------+ 15 nnyby staff  480 Apr 2 10:09 Desktop
drwx------+ 10 nnyby staff  320 Apr 2 09:47 Documents
drwx------@ 25 nnyby staff  800 Apr 2 10:58 Downloads
drwx------@ 66 nnyby staff  2112 Apr 1 09:52 Library
drwx------+ 4 nnyby staff  128 Nov 25 14:23 Movies
drwx------+ 4 nnyby staff  128 Mar 17 20:50 Music
drwx------+ 31 nnyby staff  992 Apr 2 10:58 Pictures
drwxr-xr-x+ 4 nnyby staff  128 Oct 24 14:34 Public
drwxr-xr-x  4 nnyby staff  128 Mar 20 10:40 dist
drwxr-xr-x  9 nnyby staff  288 Apr 1 14:12 src

Why can't I create a .ssh directory on macOS 10.15.4?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.