Skip to main content
Share Your Experience: Take the 2024 Developer Survey
119 votes
Accepted

Difference between .xinitrc, .xsession and .xsessionrc

~/.xinitrc is executed by xinit, which is usually invoked via startx. This program is executed after logging in: first you log in on a text console, then you start the GUI with startx. The role of ....
Gilles 'SO- stop being evil''s user avatar
103 votes
Accepted

I accidentally typed my password into the login field, is it still secure?

The concern is whether your password is recorded in the authentication log. If you're logging in on a text console under Linux, and you pressed Ctrl+C at the password prompt, then no log entry is ...
Gilles 'SO- stop being evil''s user avatar
71 votes
Accepted

Why a "login" shell over a "non-login" shell?

The idea is that a user should have (at most) one login shell per host.  (Perhaps I should say, one login shell per host per terminal — if you are simultaneously logged in to a host through multiple ...
G-Man Says 'Reinstate Monica''s user avatar
35 votes

Is there any reason why I get ^[[A when I press up arrow at the console login screen?

TLDR You're probably running sh which outputs the raw keycodes generated when you press the Up arrow key. A more advanced shell like bash intercepts these keycodes and does something with them. E.g. ...
Snowcrash's user avatar
  • 699
35 votes
Accepted

Automatically Login on Debian 9.2.1 Command Line

Edit your /etc/systemd/logind.conf , change #NAutoVTs=6 to NAutoVTs=1 Create a /etc/systemd/system/[email protected]/override.conf through ; systemctl edit getty@tty1 Paste the following lines [...
GAD3R's user avatar
  • 67.1k
31 votes

Difference between Login Shell and Non-Login Shell?

I'll elaborate on the great answer by Gilles, combined with Timothy's method for checking login shell type. If you like to see things for yourself, try the snippets and scenarios bellow. Checking ...
Patrik Stas's user avatar
29 votes
Accepted

Is it possible to have 2 ports open on SSH with 2 different authentication schemes?

So, it turns out the answer was actually way, way simpler than I thought it would be. I do however have to thank '@jeff schaller' for his comments, if it hadn't of been for him I wouldn't have ...
shawty's user avatar
  • 471
25 votes
Accepted

Turn on NumLock on startup in Linux Mint in the Login window

For all versions of Linux Mint You need to install a program needed for this purpose - numlockx; man page: sudo apt-get install numlockx Choose if you wish to achieve the goal through CLI or GUI ...
Vlastimil Burián's user avatar
22 votes
Accepted

PAM vs LDAP vs SSSD vs Kerberos

The sssd daemon acts as the spider in the web, controlling the login process and more. The login program communicates with the configured pam and nss modules, which in this case are provided by the ...
Johan Myréen's user avatar
21 votes
Accepted

Welcome banner stopping scp

Commands running on top of the ssh transport do not expect large amounts of output before they can start their server. This will affect a number of utilities. The solution is to have your ...
Chris Davies's user avatar
20 votes

How can I change what's displayed at a login shell?

The OP clearly is asking about messages displayed AFTER log in, all "/etc/issue" are displayed BEFORE login+password is entered so are off-topic. The 'login shell' steps are: show messages contained ...
Valerio's user avatar
  • 315
20 votes
Accepted

How can I check if a shell is login/interactive/batch in fish?

Use the status command: $ fish -c 'status --is-interactive; and echo yes; or echo no' no $ status --is-interactive; and echo yes; or echo no yes Also, status --is-login. That should cover your bases....
glenn jackman's user avatar
20 votes
Accepted

Ubuntu 16.04 - GUI freezes on login start page

We were able to solve it by starting the shell in secure mode and executing the following commands. apt-get update apt-get install xserver-xorg-input-all apt-get install ubuntu-desktop apt-...
Black's user avatar
  • 2,088
20 votes
Accepted

SSHing into system with ZSH as default shell doesn't run /etc/profile

ZSH just works in this way. /etc/profile is NOT an init file for ZSH. ZSH uses /etc/zprofile and ~/.zprofile. Init files for ZSH: /etc/zshenv ~/.zshenv login mode: /etc/zprofile ~/.zprofile ...
Simba's user avatar
  • 1,732
20 votes

What program in Linux computes the hash of the input password when you log in?

No specific binary does the hashing; it's done by a library call crypt(3). So, in theory, any program (even a perl script) can generate the hash. e.g. perl -e 'print crypt("hello","\$...
Stephen Harris's user avatar
17 votes
Accepted

How does X11 interact with the kernel / perform login

The shell uses a TTY device (if it’s connected to one) to obtain user input and to produce output, and not much else. The fact that a shell is connected to a TTY is determined by getty (and preserved ...
Stephen Kitt's user avatar
17 votes
Accepted

What is the intended purpose of a login shell?

Login is handled by tools other than the shell, e.g. login itself, or your desktop manager (with the help of PAM and various other tools). The purpose of a login shell isn’t to handle login, it’s to ...
Stephen Kitt's user avatar
16 votes
Accepted

Does ssh run commands (rather than shell itself) in a login shell?

login shell can mean two different things in that context: the shell that is defined as the login shell for the user in the account database. For instance: $ getent passwd stephane stephane:*:1000:...
Stéphane Chazelas's user avatar
15 votes
Accepted

Running GNU screen through SSH, the shell is not a login shell?

From the man pages of GNU screen: -s program sets the default shell to the program specified, instead of the value in the environment variable $SHELL (or "/bin/sh" if not defined). This can ...
aviro's user avatar
  • 5,632
14 votes
Accepted

How can I track script which gives me "command not found" right after the login?

Bash reads a number of different files on startup, even depending on how it's started (see the manual for the description). Then there's stuff like /etc/profile.d/ that aren't directly read by the ...
ilkkachu's user avatar
  • 140k
14 votes

Does ssh run commands (rather than shell itself) in a login shell?

No, SSH only invokes a login shell when logging you into a shell, not when running a command. This means that if you want your login initialization files to run (e.g. ~/.profile), you need to do this ...
Gilles 'SO- stop being evil''s user avatar
13 votes

How do I log out of all my active sessions?

loginctl terminate-user <Your User Name> should kill all sessions of your user
Ember's user avatar
  • 381
13 votes
Accepted

What are the pro's and con's in using the "-l" in a script shebang

[The following assumes that your unspecified "logging issue" was related to missing environment setup, normally inherited from your profile.] The -l option tells bash to read all the various "profile"...
ams's user avatar
  • 5,807
13 votes
Accepted

Live Kali Linux root/toor login not working

I don’t know if you still need this, but to anyone who does, Kali changed the password structure from root/toor to kali/kali. This was driving me crazy as it was always root/toor before. See: https://...
Matt's user avatar
  • 146
11 votes
Accepted

Why have both .bash_profile and .bashrc?

Only .bashrc is run on non-login shells, while only .bash_profile is run on login shells. .bashrc should typically contain things you want to set in every shell you open, like aliases, functions, etc. ...
Munir's user avatar
  • 3,342
11 votes
Accepted

How do I enable auto-login in Mint 18?

It seems there isn't a GUI setting for auto-login, except during initial installation. Bahamut already pointed to the right solution. When look at the file: /etc/X11/default-display-manager, it ...
Minister's user avatar
  • 226
11 votes

Bash simple one-liner to auto-login ssh

Simply ssh-copy-id [email protected] for one-stop shopping for key-pair authentication. If you don't already have a keypair to use, generate one: ssh-keygen && ssh-copy-id username@...
DopeGhoti's user avatar
  • 76.5k
10 votes

Turn on bluetooth on login screen

By default, the Bluetooth adapter does not power on after a reboot. So, if you want to auto power-on after boot you need to add the line AutoEnable=true in the configuration file /etc/bluetooth/main....
Cirelli94's user avatar
  • 303
10 votes

Automatically Login on Debian 9.2.1 Command Line

I just want to add to this discussion that the accepted answer pertains to virtual terminals. In my case, I had to edit a separate service file which is used for serial terminals. The file is found at ...
drummerboy's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible