1

I need help troubleshooting a strange problem. When I ssh into a server I have and do an su rails from root user the session closes by itself:

root@ubuntu-server:/4# su rails
rails@ubuntu-server:/4$ exit

I'm not typing in exit...it just appears by itself ...it may last more than one minute but it always closes within the first 5 seconds of a new minute, as seen below...how can I troubleshoot this?

from /var/log/auth.log:

Mar 24 19:03:13 ip-10-149-16-81 su[11304]: Successful su for rails by root
Mar 24 19:03:13 ip-10-149-16-81 su[11304]: + /dev/pts/2 root:rails
Mar 24 19:03:13 ip-10-149-16-81 su[11304]: pam_unix(su:session): session opened for user rails by root(uid=0)
Mar 24 19:04:01 ip-10-149-16-81 CRON[11317]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 24 19:04:01 ip-10-149-16-81 CRON[11318]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 24 19:04:01 ip-10-149-16-81 CRON[11319]: pam_unix(cron:session): session opened for user rails by (uid=0)
Mar 24 19:04:01 ip-10-149-16-81 CRON[11320]: pam_unix(cron:session): session opened for user rails by (uid=0)
Mar 24 19:04:01 ip-10-149-16-81 CRON[11318]: pam_unix(cron:session): session closed for user root
Mar 24 19:04:02 ip-10-149-16-81 CRON[11320]: pam_unix(cron:session): session closed for user rails
Mar 24 19:04:03 ip-10-149-16-81 CRON[11319]: pam_unix(cron:session): session closed for user rails
Mar 24 19:04:03 ip-10-149-16-81 su[11304]: pam_unix(su:session): session closed for user rails
Mar 24 19:04:04 ip-10-149-16-81 CRON[11317]: pam_unix(cron:session): session closed for user root
chicks
  • 3,639
  • 10
  • 26
  • 36
Craig
  • 289
  • 2
  • 7
  • Look at the login scripts for the rails user to see if they cause it to exit early, but you'd be unlikely to see the prompt in that case. Are you sure you're not pressing `ctrl-d`? – chicks Mar 24 '16 at 13:19
  • thanks so much brother for your help...I am absolutely sure I'm not pressing ctrl-d...also, it's strange, but if I'm in the rails console at the time it happens it will just take me out of the console but not log me out of rails user as it does if I'm not in the console, so it's quite strange behavior – Craig Mar 27 '16 at 14:21

0 Answers0