{"id":22205277,"url":"https://github.com/y10k/unix_socket_tunnel","last_synced_at":"2025-07-24T18:04:50.930Z","repository":{"id":138987382,"uuid":"168696126","full_name":"y10k/unix_socket_tunnel","owner":"y10k","description":"unix domain socket tunnel utility","archived":false,"fork":false,"pushed_at":"2019-07-06T17:04:57.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T04:16:53.628Z","etag":null,"topics":["ruby","socket","ssh-agent","ssh-agent-forwarding","tunnel"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/y10k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-01T12:44:27.000Z","updated_at":"2019-07-06T17:04:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"3fc425b5-295e-438a-88f7-44a23765567d","html_url":"https://github.com/y10k/unix_socket_tunnel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y10k%2Funix_socket_tunnel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y10k%2Funix_socket_tunnel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y10k%2Funix_socket_tunnel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y10k%2Funix_socket_tunnel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/y10k","download_url":"https://codeload.github.com/y10k/unix_socket_tunnel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245388763,"owners_count":20607164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby","socket","ssh-agent","ssh-agent-forwarding","tunnel"],"created_at":"2024-12-02T17:29:38.840Z","updated_at":"2025-03-25T03:04:38.890Z","avatar_url":"https://github.com/y10k.png","language":"Ruby","readme":"unix_socket_tunnel\n==================\n\nunix domain socket tunnel utility.\n\nRequirements\n------------\nRuby is required because this utility is ruby script.\n\nDescription\n-----------\n\nThis script tunnels unix domain socket to another path.\nIt is supposed to tunnel a socket of ssh-agent.\n\n1. Default is quiet. It displays the log on the screen with the `-v`\n   or `-l` option.\n2. It monitors the parent process and exits when the parent process is\n   finished. It is supposed to start in the background from login\n   shell. It is able to change the process ID to be monitored with the\n   `-w` option.\n3. The default umask(2) is `0077`, and the tunnel destination socket\n   refuses access from group and other. It is able to change umask\n   with the `-u` option.\n4. It makes sure that the tunnel destination directory is owned. It is\n   able to ignore its owned with `--no-dir-owned` option.\n5. It checks the security of the tunnel destination directory. It is\n   able to change security check level with\n   `--dir-access-deny-mode-mask` option.\n\nUsage\n-----\n\n```sh\n$ unix_socket_tunnel -h\nUsage: unix_socket_tunnel [options] CONNECT_PATH LISTEN_PATH\n    -v, --verbose\n    -l, --log-level=LEVEL\n    -w, --watch-pid=PID\n        --accept-timeout=SECONDS\n        --io-chunk-size=BYTES\n    -u, --umask=OCTETS\n    -m, --unix-socket-mode=OCTETS\n        --[no-]dir-owned\n        --dir-access-deny-mode-mask=OCTETS\n```\n\nExample\n-------\n\nSetting to use ssh-agent in GNU screen.\nSsh-agent has already started up at login.\n\n`.screenrc`:\n\n```\nsetenv SCREEN_SESSION 1\n```\n\n`.bashrc`:\n\n```sh\n# ssh-agent forwarding in GNU Screen session\nif [ -n \"$PS1\" ]; then          # for interactive shell\n  saved_ssh_agent_sock=\"${HOME}/.ssh/agent_sock\"\n  unix_socket_tunnel=\"${HOME}/git_work/unix_socket_tunnel/unix_socket_tunnel\"\n\n  if [ -n \"${SCREEN_SESSION}\" ]; then # add to .screenrc: setenv SCREEN_SESSION 1\n    export SSH_AUTH_SOCK=\"${saved_ssh_agent_sock}\"\n  elif shopt -q login_shell \u0026\u0026 [ -n \"${SSH_AUTH_SOCK}\" ] \u0026\u0026 [ -S \"${SSH_AUTH_SOCK}\" ]; then\n    rm -f \"${saved_ssh_agent_sock}\"\n    \"${unix_socket_tunnel}\" \"${SSH_AUTH_SOCK}\" \"${saved_ssh_agent_sock}\" \u0026\n  fi\nfi\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy10k%2Funix_socket_tunnel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy10k%2Funix_socket_tunnel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy10k%2Funix_socket_tunnel/lists"}