LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-01-2015, 02:07 PM   #1
jzoudavy
Member
 
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 180

Rep: Reputation: Disabled
lxc new container how to set password


hi all

I just created my first container, but now I am a bit stuck.

You just created an Ubuntu container (release=precise, arch=amd64, variant=default)

To enable sshd, run: apt-get install openssh-server

For security reason, container images ship without user accounts
and without a root password.


Use lxc-attach or chroot directly into the rootfs to set a root password
or create user accounts.
test@container-host:~$ lxc-ls --fancy
NAME STATE IPV4 IPV6 AUTOSTART
--------------------------------------------
mycontainer1 STOPPED - - NO

I have no clue how to use lxc-attach or chroot the set a root password.

How do I set the ubuntu container's password?
 
Old 09-01-2015, 02:52 PM   #2
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.1, LFS-current, NetBSD 6.1.3
Posts: 261

Rep: Reputation: 101Reputation: 101
Code:
chroot /path/of/container
passwd root
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Running ctdb in an LXC container PeterSteele CentOS 5 08-13-2015 08:45 AM
LXC Container: sound Not working charlie101 Linux - Virtualization and Cloud 10 06-14-2015 12:16 PM
How to use Local ISO for LXC Container? sunveer Linux - Software 0 10-04-2013 05:44 AM
script to get a lxc-container like iso of current. cod_liver_0il Slackware 1 09-10-2012 12:12 PM
How to end a Linux Container (LXC) from within? Skaperen Linux - Virtualization and Cloud 0 06-14-2011 10:37 AM


All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration