Results 1 to 4 of 4

Thread: Unable to sudo rm file from ~/.ssh

  1. #1
    Join Date
    Apr 2012
    Beans
    Hidden!

    Unable to sudo rm file from ~/.ssh

    Hi, i just installed ssh server on a couple machines and was setting up
    key auth. via a tutorial, i some how included a [ " ] at the end of the file name.
    I am unable to remove it...any suggestions.?
    Directory:
    #hadaka@the-beach:~/.ssh$ ls
    authorized_keys” config id_dsa id_dsa.pub known_hosts

    this was the formatt
    Code:
     cat ~/.ssh/id_dsa.pub | ssh hostname “cat >> ~/.ssh/authorized_keys”
    result of trying to remove without the [ " ]
    Code:
    ~/.ssh$ sudo rm authorized_keys
    rm: cannot remove `authorized_keys': No such file or directory
    when i include the quote (") it seems to start a process as it returns a
    >
    Code:
    hadaka@the-beach:~/.ssh$ sudo rm authorized_keys"
    >
    only way to recover the terminal is to ctrl/c
    and when i close the terminal...it says a process is running.
    do i need a big hammer and a trash can or is this removable??
    Last edited by Hadaka; April 8th, 2013 at 03:38 AM.
    Craving anchovy, herring and squid pizza.....with clam sauce

  2. #2
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,125
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Unable to sudo rm file from ~/.ssh

    can you show me ls -l of the file and tell use the $PWD varaible to the loaction for the file you want to remove?

    I just tried a similar example to your condition, I added a " at the >
    and it terminated properly. >"
    rm has a -f force option, but the file does not exit is confusing.
    can you try typing the firstpart of the file name then hitting tab to complete the filename?
    ~Conradin~

  3. #3
    Join Date
    Apr 2012
    Beans
    Hidden!

    Re: Unable to sudo rm file from ~/.ssh

    @conradin..thanks for responding.
    seems the threat of the hammer and trash can did the trick.
    or..maybe it was
    Code:
    sudo service ssh stop
    not sure..but by magic smoke and mirrors when i gave it
    another rm command...it vanished....
    Code:
    hadaka@the-beach:~/.ssh$ sudo rm authorized_keys”
    [sudo] password for hadaka: 
    hadaka@the-beach:~/.ssh$ ls
    config  id_dsa  id_dsa.pub  known_hosts
    weird...
    thanks again.
    **thread tools seems to not be working...not able to mark SOLVED**
    Last edited by Hadaka; April 7th, 2013 at 09:19 PM. Reason: CANT MARK SOLVED
    Craving anchovy, herring and squid pizza.....with clam sauce

  4. #4
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Unable to sudo rm file from ~/.ssh

    You probably need to escape the quotation marks so bash ignores them...
    Code:
    rm authorized_keys\"
    Or just use tab completion as conradin suggests...
    Code:
    rm auth<TAB>
    Cheesemill

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •