LinuxQuestions.org
Review your favorite Linux distribution.
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 01-06-2020, 08:17 AM   #1
motowngold
Member
 
Registered: Jan 2020
Posts: 33

Rep: Reputation: Disabled
A true newbie trying to do a UDEV command, need help


Here is my problem, UDEV rules. I know nothing about how to to them, or how to get to them. So, how to I navigate and browse to the path, as this help desk person tells me? Is it with a terminal window? This problem is referencing in getting a bitcoin wallet to work. Below is what instructions I was given. I do not know how ot get to the paths as instructed. Please help.
-----------------------

Hello there,

Sorry for the confusion. Basically you will need to browse to this path: /etc/udev/rules.d/51-usb-keepkey.rules and edit the "51-usb-keepkey.rules" and add the rules written below:

# KeepKey: Your Private Bitcoin Vault
# http://www.keepkey.com/
# Put this file into /usr/lib/udev/rules.d or /etc/udev/rules.d
# KeepKey HID Firmware/Bootloader
SUBSYSTEM=="usb", ATTR{idVendor}=="2b24", ATTR{idProduct}=="0001", MODE="0666", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="keepkey%n"
KERNEL=="hidraw*", ATTRS{idVendor}=="2b24", ATTRS{idProduct}=="0001", MODE="0666", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
# KeepKey WebUSB Firmware/Bootloader
SUBSYSTEM=="usb", ATTR{idVendor}=="2b24", ATTR{idProduct}=="0002", MODE="0666", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="keepkey%n"
KERNEL=="hidraw*", ATTRS{idVendor}=="2b24", ATTRS{idProduct}=="0002", MODE="0666", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
 
Old 01-06-2020, 08:19 AM   #2
motowngold
Member
 
Registered: Jan 2020
Posts: 33

Original Poster
Rep: Reputation: Disabled
This further instruction was given to me as an example by the help desk, but this video is not very clear to me either.

https://www.youtube.com/watch?v=bFWLI2IgLS0
 
Old 01-06-2020, 09:35 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
do you know how to open a terminal?
Are you familiar with the basics? (like the cd command, text editing?)
 
1 members found this post helpful.
Old 01-06-2020, 09:36 AM   #4
motowngold
Member
 
Registered: Jan 2020
Posts: 33

Original Poster
Rep: Reputation: Disabled
OK, so I figured out how to get to the udev/rules.d folder. Now what, how or what do I create in this folder? I tried to create a new file, but it is grayed out and wont let me save.5
 
1 members found this post helpful.
Old 01-06-2020, 09:38 AM   #5
motowngold
Member
 
Registered: Jan 2020
Posts: 33

Original Poster
Rep: Reputation: Disabled
I also found this alternative method. Is this safe, I dont know who/what python is.

SSH KeepKey Configuration with Ubuntu (Linux)
Drew Dapp
1 year ago Updated
To setup KeepKey SSH Login with Ubuntu (Linux), here are the following steps:

I. Install Python-Dev Python-Tools Libusb-1.0.0-dev Libudev-dev and Git.
Open Terminal.
Enter following command: sudo apt-get install python-dev python-setuptools libusb-1.0-0-dev libudev-dev git

II. Install Pip.
Open Terminal.
Enter following command: sudo easy_install pip

Install KeepKey Python Client.
Open Terminal.
Enter following command: sudo pip install https://github.com/keepkey/python-ke...ive/master.zip

III. Install Trezor Python Client.
Open Terminal.
Enter following command: sudo pip install trezor

IV. Install Trezor_Agent SSH.
Open Terminal.
Enter following command: sudo pip install trezor_agent

V. Generate SSH Public Key using trezor-agent.
Open Terminal.
Enter following command: trezor-agent user@sshserver (user - user name and sshserver is server name)
Enter PIN.

VI. Copy ECDSA key into Authorized Keys on SSH Server
Log into SSH Server
Copy ECDSA Key that was created from the previous step
Paste into ~/.ssh/authorized_keys file on your SSH Server
VII. Login into SSH Server using your KeepKey
Open Terminal
Enter following command - trezor-agent -c user@sshserver (user - user name and sshserver is server name)
Enter PIN
Hold KeepKey button for 2 seconds to authenticate
 
Old 01-06-2020, 09:41 AM   #6
motowngold
Member
 
Registered: Jan 2020
Posts: 33

Original Poster
Rep: Reputation: Disabled
Hi pan, I guess I do not know how to text edit. I have a file in there now, but it is not named correctly, it wont let me change the name as instructed,or remove some irrelevant stuff I saved into the file such as
# KeepKey: Your Private Bitcoin Vault
# http://www.keepkey.com/
# Put this file into /usr/lib/udev/rules.d or /etc/udev/rules.d

I assume I do not want that stuff in there, just the stuff instructed afterwards?

If so, I still cannot save it, or save as to /etc/udev/rules.d/51-usb-keepkey.rules , as instructed. I do not have permissions?

Sorry if my post sounds rambling, it is all new to me.
 
1 members found this post helpful.
Old 01-06-2020, 09:43 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you have to be root (change user to root) to be able to create/modify that file.
 
1 members found this post helpful.
Old 01-06-2020, 09:46 AM   #8
motowngold
Member
 
Registered: Jan 2020
Posts: 33

Original Poster
Rep: Reputation: Disabled
pan, how or where do I do that at?
 
Old 01-06-2020, 09:50 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
what kind of OS do you have?
Usually - in a terminal - you can execute a sudo command to change the current user (in that terminal) to root. So
Code:
sudo -i
cd /etc/udev/rules.d
edit file
exit
 
1 members found this post helpful.
Old 01-06-2020, 09:52 AM   #10
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Leave python alone for the time being. Adding udev rules can be tricky so do it the simplest way, with a plain text edit. As pan64 said, you will need to become root, which is best done with sudo. So:
Code:
sudo nano /etc/udev/rules.d/51-usb-keepkey.rules
I suggest you put this into the /etc version of the udev rules directory rather than the /lib version because the /etc version has overriding authority. It's specifically intended for system administrators to put their own rules into.

Once you are in nano, enter the text of the new rules exactly as given. Then write the file out and exit (I believe that's done with ctrl-o ctrl-x, but in any case you'll see the command codes at the bottom of the edit window).

PS: I see Pan also favours using the /etc file. His invocation of sudo is just an alternative: it gives you an interactive root shell and then you can carry out several operations as root. But if you do that remember to exit the root shell afterwards!

Last edited by hazel; 01-06-2020 at 09:55 AM. Reason: Added postscript
 
1 members found this post helpful.
Old 01-06-2020, 09:53 AM   #11
motowngold
Member
 
Registered: Jan 2020
Posts: 33

Original Poster
Rep: Reputation: Disabled
I went to my folders, and then navigated to computer/etc/udev/rules.d.

In there are files. One in there is one I somehow created in my stumbling around the net trying to find how to do this.

That file is named 01-my-first-udev.rules. It has in it the following text.

# KeepKey: Your Private Bitcoin Vault
# http://www.keepkey.com/
# Put this file into /usr/lib/udev/rules.d or /etc/udev/rules.d
# KeepKey HID Firmware/Bootloader
SUBSYSTEM=="usb", ATTR{idVendor}=="2b24", ATTR{idProduct}=="0001", MODE="0666", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="keepkey%n"
KERNEL=="hidraw*", ATTRS{idVendor}=="2b24", ATTRS{idProduct}=="0001", MODE="0666", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
# KeepKey WebUSB Firmware/Bootloader
SUBSYSTEM=="usb", ATTR{idVendor}=="2b24", ATTR{idProduct}=="0002", MODE="0666", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="keepkey%n"
KERNEL=="hidraw*", ATTRS{idVendor}=="2b24", ATTRS{idProduct}=="0002", MODE="0666", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"


I am thinking, OK, I am close, but it has those first 3 lines in it that I am guessing are irrelevant, and the it is named improperly... if that is important, I am not sure.

So, I am trying to resave that file with those first 3 lines removed, and with the as instructed name of 51-usb-keepkey.rules.

I do not know if what I just wrote even makes sense, but trying to explain exactly where I am at, and what I am guessing to do next?
 
Old 01-06-2020, 10:02 AM   #12
motowngold
Member
 
Registered: Jan 2020
Posts: 33

Original Poster
Rep: Reputation: Disabled
Ok, I was writing so fast, I did not see the suggestions. I saw Hazels first, so tring that first. I have a file, correct I think now, saved in the correct folder. I have to pull out my device, and see if it works. Standby and thank you to everyone.
 
1 members found this post helpful.
Old 01-06-2020, 10:06 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
there are some sites like this: https://www.thegeekdiary.com/beginne...udev-in-linux/ to explain what is is all about. You need to look for other pages too -like this: https://everything.explained.today/Udev/ (or the wike page).
Also you may find it useful: https://linuxconfig.org/tutorial-on-...rules-in-linux
 
1 members found this post helpful.
Old 01-06-2020, 10:09 AM   #14
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
The lines beginning with # are comments. It is always a good idea to have comment lines in a system file. Otherwise, if you come back to this file in three months' time, you won't know what the heck it is. So I would keep them in place if I were you.

The name of a udev rules file doesn't actually matter as long as it ends with .rules, but again, it makes sense to give it an informative name rather than something meaningless like "my first udev rules"!

You have now learned several useful lessons:
1) Linux configuration files are all plain text. There is no binary registry like Windows has.
2) All these files can, in principal, be modified by the root user.
3) You can become root by using the sudo command.
4) Modifying configuration files is potentially dangerous, so don't do it without being sure you know what you are doing.
 
1 members found this post helpful.
Old 01-06-2020, 10:10 AM   #15
motowngold
Member
 
Registered: Jan 2020
Posts: 33

Original Poster
Rep: Reputation: Disabled
Ok, I think I have Hazels file implemented correctly , but for some reason, my device is not detected when I plug it in.

That problem may be beyond the scope of help from here, not sure?
 
1 members found this post helpful.
  


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
[SOLVED] udev and dbus - using the notivy-send command in a script started by udev markush Slackware 2 10-14-2012 09:26 AM
UDEV: Unable to run a command line interface script after USB automount using udev mohamr2 Linux - Embedded & Single-board computer 8 08-16-2011 10:39 AM
Tried and true FC-8 installed on new(er) intel box; can't get past "Starting UDev" LateNighter Linux - General 10 03-27-2010 06:31 PM
which is true? more than one could be true? ddomiray Linux - General 3 10-26-2009 02:41 AM
Something i'am trying to achieve using udev :: need some help small_boy22 Linux - Hardware 1 06-01-2005 10:19 AM

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

All times are GMT -5. The time now is 08:22 AM.

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