Answer the question
In order to leave comments, you need to log in
Strange behavior of linux: why are files under one of the users created, but when the content is written to them, they are deleted?
The situation is this. There is Debian 8, recently it was Debian 7. There is one user (not root) in it, when working with which strange things occur. It is impossible to connect via ssh through it, although there was such an opportunity before. The `su -` command also does not help, the console looks like this:
15:05:23:[email protected]>~#su ouruser
Fri Mar 31 15:05:40 MSK 2017
15:05:40:[email protected]>~#
Mar 31 17:29:37 server su[2172]: Successful su for ouruser by root
Mar 31 17:29:37 server su[2172]: + /dev/pts/1 root:ouruser
Mar 31 17:29:37 server su[2172]: pam_unix(su:session): session opened for user ouruser by sshuser(uid=0)
Mar 31 17:29:37 server su[2172]: pam_unix(su:session): session closed for user ouruser
Answer the question
In order to leave comments, you need to log in
1. This is very similar to the fact that instead of a shell, the user has / bin / date. Just change its shell:
# chsh ouruser
Changing the login shell for ouruser
Enter the new value, or press ENTER for the default
Login Shell [/bin/date]: /bin/bash
# egrep -i -n '(exit|date)' /home/ouruser/.* 2>/dev/null
/home/ouruser/.bash_logout:1:# ~/.bash_logout: executed by bash(1) when login shell exits.
/home/ouruser/.bashrc:23:# update the values of LINES and COLUMNS.
/home/ouruser/.bashrc:114:date
/home/ouruser/.bashrc:115:exit
# mcedit -d /home/ouruser/.bashrc:114
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
set -x
if [ "`id -u`" -eq 0 ]; then
and you can see which command exits, and then find it in the profile files.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question