LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 01:07 PM   #1
jzoudavy
Member
 
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

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, 01:52 PM   #2
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.2, LFS-current, NetBSD 6.1.3, OpenIndiana
Posts: 319

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


Reply



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
LXC Container: sound Not working charlie101 Linux - Virtualization and Cloud 11 04-14-2020 01:15 AM
[SOLVED] Running ctdb in an LXC container PeterSteele CentOS 5 08-13-2015 07:45 AM
How to use Local ISO for LXC Container? sunveer Linux - Software 0 10-04-2013 04:44 AM
script to get a lxc-container like iso of current. cod_liver_0il Slackware 1 09-10-2012 11:12 AM
How to end a Linux Container (LXC) from within? Skaperen Linux - Virtualization and Cloud 0 06-14-2011 09:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:05 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
Open Source Consulting | Domain Registration