This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| cheatsheet:genericcli [2023/02/14 11:29] – created kamaradski | cheatsheet:genericcli [2023/11/12 12:52] (current) – [notes] kamaradski | ||
|---|---|---|---|
| Line 41: | Line 41: | ||
| </ | </ | ||
| + | ==== add user to sudo ==== | ||
| + | <code bash> | ||
| + | # change to superuser | ||
| + | someuser@server$ su | ||
| + | password: | ||
| + | |||
| + | # add some user to sudo | ||
| + | root@server$ / | ||
| + | |||
| + | # confirm user is added | ||
| + | root@server$ getent group sudo | ||
| + | sudo: | ||
| + | |||
| + | # test that it works | ||
| + | root@server$ su - someuser | ||
| + | someuser@server$ sudo whoami | ||
| + | [sudo] password for someuser: | ||
| + | root | ||
| + | </ | ||
| + | |||
| + | ===== user and group management ===== | ||
| + | |||
| + | ==== add user (interactive) ==== | ||
| + | |||
| + | <code bash> | ||
| + | $ adduser kamaradski | ||
| + | Adding user `kamaradski' | ||
| + | Adding new group `kamaradski' | ||
| + | Adding new user `kamaradski' | ||
| + | Creating home directory `/ | ||
| + | Copying files from `/ | ||
| + | New password: | ||
| + | Retype new password: | ||
| + | passwd: password updated successfully | ||
| + | Changing the user information for kamaradski | ||
| + | Enter the new value, or press ENTER for the default | ||
| + | Full Name []: | ||
| + | Room Number []: | ||
| + | Work Phone []: | ||
| + | Home Phone []: | ||
| + | Other []: | ||
| + | Is the information correct? [Y/n] y | ||
| + | </ | ||
| ===== RAM stats ===== | ===== RAM stats ===== | ||
| Line 177: | Line 220: | ||
| Tsx async abort: | Tsx async abort: | ||
| - | </ | ||
| - | |||
| - | ===== keys and certificates ===== | ||
| - | |||
| - | ==== create id_rsa ssh key ==== | ||
| - | <code bash> | ||
| - | $ ssh-keygen -t rsa | ||
| - | or | ||
| - | $ ssh-keygen -t rsa -b 4096 -C "< | ||
| - | </ | ||
| - | |||
| - | ==== copy local public key to remote " | ||
| - | <code bash> | ||
| - | $ ssh-copy-id -i ~/ | ||
| - | </ | ||
| - | |||
| - | ==== remove a specific host from the known_hosts file ==== | ||
| - | <code bash> | ||
| - | $ ssh-keygen -f "/ | ||
| - | |||
| - | # Host 10.0.0.10 found: line 39 | ||
| - | # Host 10.0.0.10 found: line 40 | ||
| - | / | ||
| - | Original contents retained as / | ||
| </ | </ | ||
| Line 328: | Line 347: | ||
| </ | </ | ||
| + | ==== notes ==== | ||
| + | - By default, when the target on the remote system is a directory and you don't provide a filename, scp expects that the source file name should be used. However, you must ensure that the directory path does not include a trailing slash if you don't specify the filename explicitly. | ||
| + | |||
| + | - Make sure to always use proper paths for the files you are copying. For example for a file in the local folder from where you are issuing the command use " | ||
| ===== other ===== | ===== other ===== | ||