[Bug 2481] New: Tilde expansion in -i option inconsistent

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Thu Oct 22 03:03:41 AEDT 2015


            Bug ID: 2481
           Summary: Tilde expansion in -i option inconsistent
           Product: Portable OpenSSH
           Version: 6.6p1
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: trivial
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: nick at nicklott.com

Just noticed some odd behaviour in the identity file option with ~. If
you don't leave a space between -i and the filename the ~ is not
expanded and thus the file is not found. If you leave a space it works
as expected.

ie This doesn't work:

    ssh -i~/key_file

This does:

    ssh -i ~/key_file

Excerpts from respective strace:
stat("~/.ssh/keyfile", 0x7fff73320010) = -1 ENOENT (No such file or
write(2, "Warning: Identity file ~/.ssh/ke"..., 82Warning: Identity
file ~/.ssh/keyfile not accessible: No such file or directory.

stat("/home/ec2-user/.ssh/keyfile", {st_mode=S_IFREG|0600,
st_size=1676, ...}) = 0
write(2, "usage: ssh [-1246AaCfgKkMNnqsTtV"..., 524usage: ssh
[-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]

Without a tilde it works with or without a space.

You are receiving this mail because:
You are watching the assignee of the bug.

More information about the openssh-bugs mailing list