IPhone – Why can’t I navigate to /.ssh folder on jailbroken iPhone 5S

iphonejailbreaksshterminal

I have installed OpenSSH on my jailbroken iPhone 5S, I am trying to set up ssh keys for it but I need to get to my /.ssh folder. I try to cd there while at root with cd ~/.ssh but it says "not a directory". I then tried mkdir ~/.ssh and get "cannot make directory: file exists". So once again I tried to cd ~/.ssh and still nada. I navigated to ~ and ls, and once again no .ssh directory.

$ ls -ad ~/.ssh
/var/root/.ssh
$ echo ~
/var/root

Best Answer

Looks like .ssh is a file and not a directory. Either remove the file (rm ~/.ssh) or rename it (mv ~/.ssh ~/.ssh-strange) and set up your ssh keys again.