{"id":209,"date":"2007-02-21T17:51:45","date_gmt":"2007-02-21T16:51:45","guid":{"rendered":"http:\/\/www.malcolmhardie.com\/weblogs\/angus\/2007\/02\/21\/linux-autologin\/"},"modified":"2025-02-01T03:04:16","modified_gmt":"2025-02-01T03:04:16","slug":"linux-autologin","status":"publish","type":"post","link":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/2007\/02\/21\/linux-autologin\/","title":{"rendered":"Linux autologin"},"content":{"rendered":"<p>I use a collection of virtual machines in parallels for a number of things, like testing SQLEditor and running web apps that would otherwise require lots of software dependencies. However I&#8217;ve been getting tired of logging in to my linux virtual machines all the time. If it were just a case of ssh then obviously I could set up ssh key pairs and do auto-login, but I also need direct terminal access too, in this case in the main parallels window.<\/p>\n<p>With a physical machine to get autologin in this situation would mean that the machine would boot and immediately log the user in without interaction.<\/p>\n<div style=\"border: 1px solid #333333; padding: 0.25em 1em 1em; background-color: #eeeeee\">\n<h3 style=\"font-weight: bold; color: #992222\">Important Warning<\/h3>\n<p>This represents some security risk. You need to consider your circumstances carefully first to ensure that this will not open your machine to malicious use.<\/p><\/div>\n<p>(Of course there is always the point that if someone has physical access to your machine then there&#8217;s not much hope anyway. But still &#8230;)<\/p>\n<p>Fortunately this is possible and actually quite easy if you don&#8217;t mind editing a configuration file.<\/p>\n<p>The file you need is <code>\/etc\/inittab<\/code><\/p>\n<div style=\"border: 1px solid #333333; padding: 0.25em 1em 1em; background-color: #eeeeee\">\n<h3 style=\"font-weight: bold; color: #992222\">Important Warning (2)<\/h3>\n<p><code>\/etc\/inittab<\/code> is vital to the operation of your machine. Incorrect editing will cause a number of problems.<\/p>\n<p>If you are making these changes to a virtual machine simply make another. Alternatively try logging in via ssh to undo the changes.<\/p><\/div>\n<p>The change you need to make is to find the line that looks like:<\/p>\n<p><font size=\"-1\"><code>1:2345:respawn:\/sbin\/mingetty tty1<\/code><\/font><\/p>\n<p>and change it to look like this (where username is the user that you want to autologin as)<\/p>\n<p><font size=\"-1\"><code>1:2345:respawn:\/sbin\/mingetty --autologin username tty1<\/code><\/font><\/p>\n<p><font size=\"-1\">The original source of this is <a href=\"http:\/\/easymamecab.mameworld.net\/html\/autologin.htm\">EasyMameCab<\/a>; which looks like a clever idea in itself. They are using linux as the base system for building a video game cabinet, so obviously they don&#8217;t want logins appearing. <\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use a collection of virtual machines in parallels for a number of things, like testing SQLEditor and running web apps that would otherwise require lots of software dependencies. However I&#8217;ve been getting tired of logging in to my linux virtual machines all the time. If it were just a case of ssh then obviously [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,14],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-linux","category-writing-software"],"_links":{"self":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":1,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":1484,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts\/209\/revisions\/1484"}],"wp:attachment":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}