ubuntu12.04无法登录

ubuntu12.04无法登录

我正在使用 Ubuntu 12.04。我无法登录。我进入 grub 菜单并转为 root,删除我的/home/user/.Xauthority文件并更改我的密码。我转到/home/user/.profile/home/user/profile重新启动,然后就可以登录了(通过将 .profile 移至其他名称可以解决这个问题)。

但是如果我处于空闲状态并且 Ubuntu 显示屏幕保护程序,则我无法登录。我已按下Ctrl+ Alt+F1并删除/home/user/.Xauthority。我检查了 的存在/home/user/.profile并且它不存在。我无法从连接到盒子的键盘登录 X。我可以ssh -CXY进入 ubuntu 盒子并毫无问题地登录。有人能帮我解决这个问题吗?

答案1

如何创建新的 /home/user/.profile:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

复制、粘贴、保存..

相关内容