Force fossil to prompt for user and password on commit? - fossil

Assuming I've cloned a public repository from chiselapp.com anonymously using these commands:
$ fossil clone https://chiselapp.com/user/elviejo/repository/dwpt2 dwpt2.fossil
$ fossil open dwpt2.fossil
And now I want to commit a new file with:
$ fossil commit -m "these are my modifications"
How can Fossil prompt me for my user login and password?
PS: I know I could clone in the first place with the syntax:
https://user:pass#chiselapp.com
But let's assume I can't clone again...
Thank you.

It's not entirely clear from your question which username and password you mean. I'm going to assume you mean the user name and password used to identify yourself to the repository on chiselapp.com — in other words, the sync username and password, as opposed to the commit username.
You can change the remote URL using the fossil remote-url command. As it says on the help page:
The remote-url is set automatically by a "clone" command or by any
"sync", "push", or "pull" command that specifies an explicit URL.
The default remote-url is used by auto-syncing and by "sync", "push",
"pull" that omit the server URL.
So if you want to change the username used when syncing, the following should work:
$ fossil remote-url https://user#chiselapp.com/user/elviejo/repository/dwpt2
$ fossil commit
If the password is not specified, fossil will prompt you to enter it.
(Note that if the autosync setting is turned off, then commit will not be enough; you'd have to sync, push or pull).

Related

Creating user in ubuntu from AWS

Using AWS (Amazon Web Services) I have created an Ubuntu 16.10 instance and I am able to login using a pem file like this:
ssh -i key.pem ubuntu#52.16.73.14.54
After I am logged, I can see that I am able to execute:
sudo su
(with no password), however the file /etc/sudoers does NOT contain any reference to the user current user: ubuntu.
How can I create another user with exactly the same behavior (without touching the sudoers file) from terminal in a NON interactive way?
I tried:
sudo useradd -m -c "adding a test user" -G sudo,adm -s /bin/bash testuser
But after I become "testuser" if I invoke:
sudo su
I have to provide a password. Which is exactly the way I want to avoid.
You can't do this without touching sudo, beacuse the ubuntu user is given passwordless access specifically.
$ for group in `groups ubuntu`; do sudo grep -r ^[[:space:]]*[^#]*$group[[:space:]] /etc/sudoers* ; done
/etc/sudoers.d/90-cloud-init-users:ubuntu ALL=(ALL) NOPASSWD:ALL
/etc/sudoers.d/90-cloud-init-users:ubuntu ALL=(ALL) NOPASSWD:ALL
/etc/sudoers:%sudo ALL=(ALL:ALL) ALL
But what you can do is create a new sudoers file without touching any existing files. sudo is typically configured these days to read all the configurations in a directiory, usually /etc/sudoers.d/, preceisely so that one failing config doesn't effect the rest of sudo.
In your case, you might want to give an admin group sudoless access rather than your user. Then you can add access in the future to other users without changing sudo config.

Change jupyter notebook server password

I would like to change my jupyter notebook server's password to something else. I see on Jupyter's documentation (http://jupyter-notebook.readthedocs.org/en/latest/public_server.html) how to prepare a password for ostensibly a new server but not how to change an existing one.
Can I simply:
Generate a new SHA hash for a password as the documentation above specifies
Replace the password in the PWDFILE environment variable (located in jupyter_notebook_config.py)
Restart the jupyter server
Basically, I'm asking because I don't want to confuse and/or mess up the authentication system by just changing things.
From version 5.0, you can easily change current password with jupyter notebook password command.
Note : I tested it on windows environment.
Start -> Anaconda Powershell Prompt
It will display you the prompt like below:
(base) PS C:\yourName >
Enter below command :
(base) PS C:\yourName > jupyter notebook password
It will ask you for new password
Currently its 2022 and the jupyter notebook password still works
Reposting as an answer:
The process to change the password should be just the same as setting it in the first place. Jupyter hashes the password you enter, and compares it with the hash it loaded from the config file. It doesn't copy the hash to any other persistent storage (though it does store it in memory, so you will need to restart the notebook server).
I'm not sure how environment variables are involved - I don't think the instructions use any for the password.

linux running command as root from c code that run as normal user

I have a c++ code and I need to running from it a command to adjust the system time.
so I thought using system("su root -c date hh:mm") command from my c++ code.
The problem is that when I write 'su root -c date hh:mm' in the terminal its requires password after, and how can I pass the password to the system command in one line?
or another solution...
Thanks!
A workaround is to modify the sudoers file and remove the requirement of a password from your user ID for a particular script to have sudo privileges.
Enter sudo visudo
After this, add the details in the following manner.
username ALL=(ALL) NOPASSWD: /path/to/script
Another method would be to pipe the password as input to the sudo command. I don't recommend this, as you would be entering your password as plain text. You could use a variable to store the password, and then access it, but it still isn't a secure method. You could run the command as
echo $PASSWORD | sudo ./a.out

sent my application to different account on bitbucket

i sent my rails app to someone Else's bit bucket account using git by mistake.every time i try to create a new repository and send my app it asks me for that other persons account password.how can i undo this?
You can set correct account for you git repo, by following command:
git config --global user.name "Your Name Here"
You can see these steps in gitbucket help page.
Other this which can help you is gitcredentials by which you is used to manage credentials
from the user. More details for this command is here.
git config credential.https://example.com.username myusername

Could not upload files error in GitFTP

I'm following tutorial on http://anantgarg.com/2013/09/25/git-ftp-for-windows/ and get error:
$ git ftp init
There are 720 files to sync:
[1 of 720] Buffered for upload '.gitignore'.
[2 of 720] Buffered for upload 'wp-config-sample.php'.
....
[24 of 720] Buffered for upload 'wp-content/plugins/woocommerce/admin/post-types/writepanels/order-item-html.php'.
Uploading ...
fatal: Could not upload files., exiting...
what could be the problem? I've set the password using quotes ( 'mypassword' ) but same error still occur
You can see output of the exact error by using the '-v' flag for super-verbose output.
The problem could be one of the following
Incorrect FTP credentials - check that the server, username, and password are all correct.
URL/server: make sure to include the protocol with the URL if not standard FTP
(sftp://ftp.domain.com:22).
Password: Try also removing the quotes around the password
The server path is not set or incorrect. Often, an FTP login takes you to the server root. You may not have write-privileges there. You'll need to set the site root path.
try setting path with in the URL argument ftp://ftp.domain.com/public_html
Try doing an 'init' via command-line arguments instead (NOT via Git config settings) and set verbose output using '-v':
git ftp init -u username -p 'password' -v ftpserverurl.com
I think you should use ftp-git, it's a GUI tool to push changed files in git repository to ftp server. And it's more error-friendly.
You can check the changed files in GUI way, and it can save your ftp connection details for future use.