Results 1 to 3 of 3

Thread: SSH but not SFTP

  1. #1
    Join Date
    Oct 2007
    Location
    San Diego, CA
    Beans
    155
    Distro
    Ubuntu 10.04 Lucid Lynx

    SSH but not SFTP

    Alright, I just setup a new Ubuntu 12.04 LTS server with a LAMP stack + Including OpenSSH server.

    This users directory is located...
    Code:
    /var/www/vhosts/test.com/
    Where the name of the user is test
    I created this user via...
    Code:
    useradd test
    passwd test
    Now I also changed the users shell to bash after i realized that it was defaulted to sh.

    Once I had setup ssh and the users home directory I then tried to sftp in with the users creds to no avail. (I have confirmed SFTP does work for root)

    So my question is how can I activate sftp for this user?

    I just checked the auth.log and found the following
    Code:
    Jan 12 00:44:26 TC1 sshd[4814]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
    Jan 12 00:44:26 TC1 sshd[4814]: Accepted password for TEST from XX.XX.XXX.XXX port 60247 ssh2
    Jan 12 00:44:26 TC1 sshd[4814]: pam_unix(sshd:session): session opened for user TEST by (uid=0)
    Jan 12 00:44:27 TC1 sshd[4826]: subsystem request for sftp by user TEST
    Jan 12 00:44:27 TC1 sshd[4814]: pam_unix(sshd:session): session closed for user TEST
    Further research as uncovered the following thread on another site...
    http://www.unix.com/linux/161311-use...my-server.html

    After I too tried to manually run the sftp-server I get the following error
    Code:
    Couldn't open /dev/null: Permission denied
    ls -l of /dev/null shows
    Code:
    crw------- 1 root root 1, 3 Jan  8 14:40 /dev/null
    I am wary to change anything until i get confirmation that this indeed is the issue as the above link suggests
    Last edited by ductiletoaster; January 12th, 2013 at 07:03 AM. Reason: New evidence

  2. #2
    Join Date
    Oct 2007
    Location
    San Diego, CA
    Beans
    155
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: SSH but not SFTP

    Alright sure enough this was the issue... I fixed it by changing the permissions on /dev/null
    Code:
    chmod 666 /dev/null
    From what I can tell this is the correct action to take but if a better solution is found plz PM me. Thanks!

  3. #3
    Join Date
    Dec 2010
    Beans
    573
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: SSH but not SFTP

    The /dev/null should have a permissions mask of 666 so what you did would be the correct solution.

    Do you have any idea how it got switched?

Tags for this Thread

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
  •