Password for default system user created in JupyterHub - linux

I am running Jupyter-Hub with default authenticator and default spawner. Logged in to Jupyter-Hub with system username (admin). I added a new user called user1 in JupyterHub web console. The user got created in both the machine and Jupyter-Hub server as I added c.Authenticator.create_system_users = True in the config file. When I checked the machine users, user1 is added because of the above property added in the config file. Can anyone tell me what is the password for user1 as there is no password option to be given in Jupyter-Hub? I tried with empty, user1, 12345 and 123456.
I was trying to switch user by using su command. i.e su user1. It asks for the password.
when i cat /etc/shadow this is what i got,
user1:*:121212:0:99999:7:::

As stated in the docs (https://github.com/jupyterhub/jupyterhub/blob/master/docs/source/getting-started/authenticators-users-basics.md#use-localauthenticator-to-create-system-users), this option essentially acts like the adduser command. Even on command line this just creates the user, you cannot login to this user before you set a password via the passwd command.
Also, like the docs said, it is not recommended when JupyterHub users are directly mapped onto UNIX users, probably in part because of this password limitation...

Related

Why does jenkins need sudo password when ssh account doesn't?

My linux user account has the rights to run a particular sudo command without a password prompt. I am trying to implements jenkins to run this command. It is set up to ssh as my user account on the box with the Publish Over SSH plugin.
When I am in the box $USER shows the correct user, but when I try to run "sudo {command}" (which runs without password when I am using that box normally with my user) it requires password. What is causing this behavior?
Because it is configured to do so. There is file /etc/sudoers specifying these rules and there is respective manual page describing how does this file and the roles work. It is probably a good start to read.

Windows user added from "net rpc" command is disabled

I'm trying to create a Windows user local account from Linux bash.
I use the following command from Linux server in order to create "foo" windows local account on Windows server:
net rpc user add foo password -SWindowsHostname -UwindowsAdminUser%windowsAdminPassword
After executing the command, "foo" was correctly created on WindowsHostname server as local account but it is set as "Disabled".
I opened the "Foo" account properties (from lusrmgr window) and the options in the General tab are:
User must change password at next logon (selected)
User cannot change password (disabled - not select-able)
Password never expires (disabled - not select-able)
Account is disabled (selected)
Account is locked out (disabled - not select-able)
Is there any way to enable account using Linux server with net rpc command or create account already enabled?
In the documentation of net rpc user add command I saw -F option:
(net [<method>] user ADD <name> [password] [-c container] [-F user flags] [misc. options] [targets])
But there isn't any explanation of this "user flag" and how to use the -F option.

how to control users login on Linux machine according to configuration file

I have Linux red-hat machine version 6.x
This machine is a server machine that serve many users ( 2000 diff users that login to this machine )
Login/password
Login – root
Password – Pass123
But on Some users I want to disable the login access
And all other users I want to enable the login access to the machine
As the following way
I want to create file - /etc/logins_users.txt
#Users disable/enable
Uhdwe 0
Hdec 0
Tfsge 1
Okdejb 0
Wfdxdswh 1
.
.
.
.
.
.
remark - User name is Uniq Name
So if user get value 0 then the access to the server is denied
but if value is 1 then users will login to the server
So the Question is how to disable/enable users login according to the file /etc/logins_users.txt ?
If you are using PAM to authenticate, you may use the pam_listfile.so module to achieve this: http://linux.die.net/man/8/pam_listfile
Basically you create a file here e.g. /etc/logins_users.txt with content
user1
user2
user3
and in your PAM configuration for e.g. /etc/pam.d/sshd you need to add:
auth required pam_listfile.so item=user onerr=fail sense=allow file=/etc/logins_user.txt
Doing so allows all users specified in your file to login via SSH.
nano /etc/ssh/sshd_config
Append following names (directives):
DenyUsers User1 User2 WhatEverYouLike
DenyGroups root finadmin WhatEverYouLike
Save, restart sshd

Amazon EC2 - Prompted for Password when Switching to Passwordless User

Some background ...
I've just started using Amazon EC2 and I have a question regarding users and passwords.
As you surely well know, the default user (which in the case of Ubuntu Server 12.04 LTS is named ubuntu) doesn't have a password but instead uses public-private key authentication to login.
For reference, here's the contents of my /etc/sudoers.d/90-cloudimg-ubuntu file:
# ubuntu user is default user in cloud-images.
# It needs passwordless sudo functionality.
ubuntu ALL=(ALL) NOPASSWD:ALL
My question ...
I've since created a second user named jdoe who is a member of the admin group. The user jdoe has a password as well as a public-private key pair.
When logged in as jdoe I try to switch to the default ubuntu user using the following command, but I'm unexpectedly prompted for a password. How come? The user ubuntu (afaik) doesn't have a password!
jdoe#host:~$ su ubuntu
Password:
Thanks in advance for your help and comments!
su and sudo are 2 different things and you're getting confused.
When you login as ubuntu and run any command using sudo, it will not ask for password because of ubuntu ALL=(ALL) NOPASSWD:ALL
Now jdoe is a part of admin group but admin groups needs to provide password as per %admin ALL=(ALL) ALL. This statement is found by running visudo. Please note that this statement does not have NOPASSWD:ALL
So when user jdoe runs any command as sudo, he has to enter the password
Now, su is entirely different aspect thansudo. And when you run su ubuntu, there is no sudo thing in picture. So it will ask you for the password of user ubuntu.
In otehrwords, the statement jdoe#host:~$ su ubuntu is asking you to enter the password of user ubuntu. As you do not have password for ubuntu set, this will never succeed.
However, if you login as ubuntu and try sudo su jdoe, it will not ask for any a pssword. But.... if you login as ubuntu and run su jdoe, it will ask you for the password of user jdoe. Try this so you get better understanding around how it works.

Glassfish: How to do asadmin commands without password?

every time I enter a CLI-command for glassfish like this asadmin start-instance i1 I am prompted to enter the admin-username and admin-password.
How can I disable the need for entering these credentials?
I plan to write scripts for running commands like this and I think it's not possible to enter the credentials in a bash script.
Thanks
The password file option is perhaps to verbose.
Simply do the following:
asadmin start-domain mydomain
asadmin login
Put in the admin user name and the admin password.
In your user home directory a file will get created
".asadminpass] successfully.
Make sure that this file remains protected.
Information stored in this file will be used by
asadmin commands to manage the associated domain.
Command login executed successfully."
You can set the password from a file instead of entering the password at the command line.
The --passwordfile option takes the file containing the passwords:
AS_ADMIN_PASSWORD=value
AS_ADMIN_ADMINPASSWORD=value
AS_ADMIN_USERPASSWORD=value
AS_ADMIN_MASTERPASSWORD=value

Resources