From 899e539cb133762e4e02310eb2ada2c80930c0fd Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 15 Aug 2016 17:24:05 -0700 Subject: [PATCH] cmd_ssh: ~ is not always /home On OS-X, in particular, ~foo expands to /Users/foo . We delegate everything to os.path.expanduser(), which should know the local convention. --- src/wormhole/cli/cmd_ssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wormhole/cli/cmd_ssh.py b/src/wormhole/cli/cmd_ssh.py index 715f0bc..b452cec 100644 --- a/src/wormhole/cli/cmd_ssh.py +++ b/src/wormhole/cli/cmd_ssh.py @@ -84,7 +84,7 @@ def invite(cfg, reactor=reactor): if cfg.ssh_user is None: ssh_path = expanduser('~/.ssh/'.format(cfg.ssh_user)) else: - ssh_path = '/home/{}/.ssh/'.format(cfg.ssh_user) + ssh_path = expanduser('~{}/.ssh/'.format(cfg.ssh_user)) auth_key_path = join(ssh_path, 'authorized_keys') if not exists(auth_key_path): print("Note: '{}' not found; will be created".format(auth_key_path))