Permitir que um novo usuário acesse / use / reivindique a casa do usuário antigo

0

Eu estava tendo problemas de loop de logon com uma conta de usuário, user1, então criei um novo usuário admin2 com direitos totais.

Existe uma maneira fácil de usar apenas o ambiente antigo do usuário1 para o novo usuário2?

Idealmente, eu excluiria user1 do login, e user2 teria o diretório home do user1?

Espero que seja fácil e resolva os loops de login. O usuário2 não tem um loop de login agora.

ls -l /home/rb1888/

dr-xr-xr-x 18 rb1888 rb1888     4096 Jul 26 12:33 . 
drwxr-xr-x  6 root   root       4096 Jul 24 16:18 ..   
-rw-------  1 rb1888 rb1888     9112 Jul 26 12:55 .bash_history
-rw-r--r--  1 rb1888 rb1888      220 Jun  9  2015 .bash_logout 
-rw-r--r--  1 rb1888 rb1888     3760 Jun  9  2015 .bashrc  
drwx------ 20 rb1888 rb1888     4096 Jul 25 17:19 .cache
drwx------ 15 rb1888 rb1888     4096 Jul  9  2015 .config  
drwx------  3 root   root       4096 Jun  9  2015 .dbus 
drwxr-xr-x  4 rb1888 rb1888     4096 Jun  9  2015 Desktop  
-rw-r--r--  1 rb1888 rb1888       25 Jun  9  2015 .dmrc   
drwxr-xr-x  2 rb1888 rb1888     4096 Jul 26 12:53 Documents
drwxr-xr-x  2 rb1888 rb1888     4096 Jun  9  2015 Downloads  
drwxrwxrwx  2 root   root       4096 Jun 10  2015 ftpfiles  
drwx------  3 rb1888 rb1888     4096 Jul 25 17:18 .gconf  
drwx------  2 root   root       4096 Jul 25 17:18 .gvfs
-rw-------  1 rb1888 rb1888     1608 Jul 25 17:18 .ICEauthority
drwx------  3 rb1888 rb1888     4096 Jun  9  2015 .local  
drwx------  4 rb1888 rb1888     4096 Jun  9  2015 .Mozilla   
drwxr-xr-x  2 rb1888 rb1888     4096 Jun  9  2015 Music   
drwxr-xr-x  2 rb1888 rb1888     4096 Jun  9  2015 Pictures   
-rw-r--r--  1 rb1888 rb1888      675 Jun  9  2015 .profile    
drwxr-xr-x  2 rb1888 rb1888     4096 Jun  9  2015 Public   
-rw-r--r--  1 rb1888 rb1888        0 Jun  9  2015 .sudo_as_admin_successful   
drwxr-xr-x  2 rb1888 rb1888     4096 Jun  9  2015 Templates    
drwxr-xr-x  2 rb1888 rb1888     4096 Jun  9  2015 Videos
-rw-rw-r--  1 rb1888 rb1888    23675 Jun  9  2015 webmin_1.750_all.deb
-rw-r--r--  1 root   root   26195366 May 12  2015 webmin_1.750_all.deb.1
-rw-------  1 rb1888 rb1888       52 Jul 26 12:59 .Xauthority
-rw-------  1 rb1888 rb1888    25148 Jul 26 12:59 .xsession-errors
-rw-------  1 rb1888 rb1888     2081 Jun  9  2015 .xsession-errors.old

Aqui estão alguns recortes de Auth.log de Ken (user2) e rb1888 (user1). Eu posso ver que user1 não tem systemd: pan_unix(systemd-user:session) nele como user2, e não tem nenhum problema em logar e permanecer na GUI.

RB1888 AUTOLOGON
Jul 26 15:26:42 content lightdm: pam_unix(lightdm-autologin:session): session opened for user rb1888 by (uid=0)
Jul 26 15:26:42 content systemd-logind[643]: New session c1 of user rb1888.   
Jul 26 15:26:42 content systemd: pam_unix(systemd-user:session): session opened for user rb1888 by (uid=0)   
Jul 26 15:26:45 content gnome-keyring-daemon[1447]: couldn't access control socket: /run/user/1000/keyring/control: No such file or directory    
Jul 26 15:26:45 content gnome-keyring-daemon[1462]: couldn't access control socket: /run/user/1000/keyring/control: No such file or directory   
Jul 26 15:26:45 content gnome-keyring-daemon[1463]: couldn't access control socket: /run/user/1000/keyring/control: No such file or directory 
Jul 26 15:27:11 content lightdm: pam_unix(lightdm-autologin:session): session closed for user rb1888    
LOGOFF (29 seconds)    
KEN LOGIN
Jul 26 15:40:09 content lightdm: pam_unix(lightdm:session): session opened for user ken by (uid=0)    
Jul 26 15:40:09 content systemd-logind[643]: New session c6 of user ken.    
Jul 26 15:40:09 content systemd: pam_unix(systemd-user:session): session opened for user ken by (uid=0)
Jul 26 15:40:11 content gnome-keyring-daemon[3738]: The SSH agent was already initialized 
Jul 26 15:40:11 content gnome-keyring-daemon[3738]: The GPG agent was already initialized 
Jul 26 15:40:11 content gnome-keyring-daemon[3738]: The Secret Service was already initialized  
Jul 26 15:40:11 content gnome-keyring-daemon[3738]: The PKCS#11 component was already initialized   
Jul 26 15:40:12 content polkitd(authority=local): Registered Authentication Agent for unix-session:c6 (system bus name :1.172 [/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
----
1 AUG rb1888 /home/rb1888/.xsession-errors (only last bad login as its long file)  
openConnection: connect: No such file or directory  
cannot connect to brltty at :0  
upstart: upstart-event-bridge main process (10640) terminated with status 1 
upstart: upstart-event-bridge main process ended, respawning 
upstart: upstart-event-bridge main process (10655) terminated with status 1 
upstart: upstart-event-bridge main process ended, respawning  
upstart: upstart-event-bridge main process (10660) terminated with status 1   
upstart: upstart-event-bridge main process ended, respawning   
upstart: upstart-event-bridge main process (10667) terminated with status 1  
upstart: upstart-event-bridge main process ended, respawning 
upstart: upstart-event-bridge main process (10674) terminated with status 1
upstart: upstart-event-bridge main process ended, respawning
upstart: upstart-event-bridge main process (10681) terminated with status 1 
upstart: upstart-event-bridge main process ended, respawning
upstart: upstart-event-bridge main process (10685) terminated with status 1
upstart: upstart-event-bridge main process ended, respawnin 
upstart: upstart-event-bridge main process (10693) terminated with status 1 
upstart: upstart-event-bridge main process ended, respawning  
upstart: upstart-event-bridge main process (10700) terminated with status 1
upstart: upstart-event-bridge main process ended, respawning
upstart: upstart-event-bridge main process (10703) terminated with status 1
upstart: upstart-event-bridge main process ended, respawning  
upstart: upstart-event-bridge main process (10707) terminated with status 1
upstart: upstart-event-bridge respawning too fast, stopped 
upstart: gnome-session (Unity) main process (10739) terminated with status 1
upstart: logrotate main process (10618) killed by TERM signal
upstart: upstart-dbus-session-bridge main process (10719) terminated with 
status 1
upstart: indicator-bluetooth main process (10788) killed by TERM signal  
upstart: indicator-power main process (10789) killed by TERM signal   
upstart: indicator-datetime main process (10790) killed by TERM signal    
upstart: indicator-session main process (10800) killed by TERM signal   
upstart: indicator-printers main process (10793) killed by TERM signal  
upstart: indicator-application main process (10819) killed by TERM signal
upstart: Disconnected from notified D-Bus bus
    
por Ken C 24.07.2017 / 23:11

1 resposta

0

Dos comentários ...

Em terminal ... (altere o kenc para o nome de usuário correto)

ls -al /home/kenc/.*thority

Você deve ver algo assim ...

-rw------- 1 kenc kenc 314660 Jul 23 19:10 /home/kenc/.ICEauthority
-rw------- 1 kenc kenc     58 Jun 23 13:05 /home/kenc/.Xauthority

No entanto, se você perceber que é próprio em root , e / ou as proteções de arquivos estão erradas, como neste exemplo ...

-rwxrwxrwx 1 root root 314660 Jul 23 19:10 /home/kenc/.ICEauthority
-rwxrwxrwx 1 root root     58 Jun 23 13:05 /home/kenc/.Xauthority

Emita então estes comandos ...

sudo chown kenc:kenc /home/kenc/.ICEauthority
sudo chown kenc:kenc /home/kenc/.Xauthority
sudo chmod 600 /home/kenc/.ICEauthority
sudo chmod 600 /home/kenc/.Xauthority
    
por heynnema 26.07.2017 / 00:48