X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/829fd7e3d772182d322682505df2c99df4b2a9e2..6f1c0e1dd16f53ce4fb7e8785a130e5f588500e5:/services/login-sync/bin/arvados-login-sync diff --git a/services/login-sync/bin/arvados-login-sync b/services/login-sync/bin/arvados-login-sync index fc11e2776b..e1b8c484f0 100755 --- a/services/login-sync/bin/arvados-login-sync +++ b/services/login-sync/bin/arvados-login-sync @@ -68,7 +68,6 @@ begin logins.each do |l| next if seen[l[:username]] seen[l[:username]] = true if not seen.has_key?(l[:username]) - @homedir = "/home/#{l[:username]}" unless uids[l[:username]] STDERR.puts "Creating account #{l[:username]}" @@ -85,6 +84,7 @@ begin out: devnull) end # Create .ssh directory if necessary + @homedir = Etc.getpwnam(l[:username]).dir userdotssh = File.join(@homedir, ".ssh") Dir.mkdir(userdotssh) if !File.exists?(userdotssh) @key = "####################################################################################### @@ -100,6 +100,7 @@ begin FileUtils.chown_R(l[:username], l[:username], userdotssh) File.chmod(0700, userdotssh) File.chmod(0750, @homedir) + File.chmod(0600, userauthkeys) end devnull.close @@ -108,4 +109,3 @@ rescue Exception => bang puts bang.backtrace.join("\n") exit 1 end -