You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ rclone config2020/04/25 08:29:49 NOTICE: Config file "/home/nahcnuj/.config/rclone/rclone.conf" not found - using defaultsNo remotes found - make a new onen) New remotes) Set configuration passwordq) Quit confign/s/q> nname> gdrive...12 / Google Cloud Storage (this is not Google Drive) \ "google cloud storage"13 / Google Drive \ "drive"...Storage> drive** See help for drive backend at: https://rclone.org/drive/ **Google Application Client IdSetting your own is recommended.See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
Create a new project (or open an existing project)
Click API とサービスを有効化
Click Google Drive API
Click 有効にする
Click 認証情報
Click 認証情報を作成
Click ウィザードで選択
Select その他の UI(Windows、CLI ツールなど) and アプリケーション データ
Click 必要な認証情報
Enter the following:
サービス アカウント名: backup (something you like)
ロール: Project > オーナー
サービス アカウント ID: backup (default)
キーのタイプ: JSON (recommended)
Click 次へ, download the JSON file
Click 同意画面を設定
Select 内部
Enter the following:
アプリケーション名: Rclone
Click スコープを追加
Select Google Drive API ../auth/drive Google ドライブのすべてのファイルの表示、編集、作成、削除
Click 追加
Click 保存
Go back 認証情報
Click 認証情報を作成
Click OAuth クライアント ID
Select その他
Enter Rclone as 名前
If you leave this blank, it will use an internal key which is low performance.Enter a string value. Press Enter for the default ("").client_id> 000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.comGoogle Application Client SecretSetting your own is recommended.Enter a string value. Press Enter for the default ("").client_secret> XXXXXXXXXXXXXXXXXXXXXXXXScope that rclone should use when requesting access from drive.Enter a string value. Press Enter for the default ("").Choose a number from below, or type in your own value 1 / Full access all files, excluding Application Data Folder. \ "drive" 2 / Read-only access to file metadata and file contents. \ "drive.readonly" / Access to files created by rclone only. 3 | These are visible in the drive website. | File authorization is revoked when the user deauthorizes the app. \ "drive.file" / Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website. \ "drive.appfolder" / Allows read-only access to file metadata but 5 | does not allow any access to read or download file content. \ "drive.metadata.readonly"scope> 1ID of the root folderLeave blank normally.Fill in to access "Computers" folders (see docs), or for rclone to usea non root folder as its starting point.Note that if this is blank, the first time rclone runs it will fill itin with the ID of the root folder.Enter a string value. Press Enter for the default ("").root_folder_id> Service Account Credentials JSON file path Leave blank normally.Needed only if you want use SA instead of interactive login.Enter a string value. Press Enter for the default ("").service_account_file> Edit advanced config? (y/n)y) Yesn) No (default)y/n> nRemote configUse auto config? * Say Y if not sure * Say N if you are working on a remote or headless machiney) Yes (default)n) Noy/n> nPlease go to the following link: <Click URL shown here>Log in and authorize rclone for accessEnter verification code> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxConfigure this as a team drive?y) Yesn) No (default)y/n> n[gdrive]type = driveclient_id = 000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.comclient_secret = XXXXXXXXXXXXXXXXXXXXXXXXscope = drivetoken = ...--------------------y) Yes this is OK (default)e) Edit this remoted) Delete this remotey/e/d> yCurrent remotes:Name Type==== ====gdrive drivee) Edit existing remoten) New remoted) Delete remoter) Rename remotec) Copy remotes) Set configuration passwordq) Quit confige/n/d/r/c/s/q> q
Commands:
rclone lsd gdrive:: show directories in root directory of Google Drive
rclone ls gdrive:: show ALL files in Google Drive
rclone mkdir gdrive:<DIR>: create a <DIR> directory to Google Drive
rclone copy <FILE> gdrive:<DIR>: copy a <FILE> file to <DIR> in Google Drive
rclone copy gdrive:<DIR> <DIR>: download the <DIR> directory in Google Drive to the local <DIR> directory
By the way, on Windows Subsystems for Linux (WSL)...
user@DESKTOP-8PA9IIL /mnt/c/Users/user
$ ping raspberrypiping: raspberrypi: Name or service not knownuser@DESKTOP-8PA9IIL /mnt/c/Users/user
$ ping raspberrypi.localping: raspberrypi.local: Name or service not known
$ sudo cat /etc/hostssudo: unable to resolve host nahcnuj: Name or service not known127.0.0.1 localhost::1 localhostff02::1 ip6-allnodesff02::2 ip6-allrouters127.0.1.1 raspberrypi
Replace raspberrypi to nahcnuj (or your hostname):
$ sudo adduser <USERNAME>...New password: <PASSWORD>Retype new password: <PASSWORD>...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
Give the created user sudo permission
$ sudo gpasswd -a <USERNAME> sudoAdding user <USERNAME> to group sudo
C:\Users\user>ssh-keygen -t rsa -b 2048Generating public/private rsa key pair.Enter file in which to save the key (C:\Users\user/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in C:\Users\user/.ssh/id_rsa.Your public key has been saved in C:\Users\user/.ssh/id_rsa.pub.The key fingerprint is:SHA256:******************************************* user@DESKTOP-8PA9IILThe key's randomart image is:...C:\Users\user>scp .ssh\id_rsa.pub nahcnuj@nahcnuj.local:~/.ssh/id_rsa.pubThe authenticity of host 'nahcnuj.local (fe80::69eb:99b2:1193:cf1a%16)' can't be established.ECDSA key fingerprint is SHA256:*******************************************.Are you sure you want to continue connecting (yes/no)?Warning: Permanently added 'nahcnuj.local,fe80::69eb:99b2:1193:cf1a%16' (ECDSA) to the list of known hosts.nahcnuj@nahcnuj.local's password:id_rsa.pub 100% 403 70.7KB/s 00:00
On Raspi:
$ cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
On Windows:
C:\Users\user>ssh -i .ssh\id_rsa nahcnuj@nahcnuj.localLinux nahcnuj 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7lThe programs included with the Debian GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.Last login: Fri Apr 24 22:02:17 2020 from fe80::a6:692d:9e6:cbc1%wlan0SSH is enabled and the default password for the 'pi' user has not been changed.This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.nahcnuj@nahcnuj:~ $
Disable password authentication
On Raspi (from SSH connected above):
Open /etc/ssh/sshd_config and enter the following line:
PasswordAuthentication no
Restart SSH server:
$ sudo service ssh restart
If no password is given, Raspi denies the access:
$ ssh nahcnuj@192.168.0.13The authenticity of host '192.168.0.13 (192.168.0.13)' can't be established.ECDSA key fingerprint is SHA256:*******************************************.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.0.13' (ECDSA) to the list of known hosts.nahcnuj@192.168.0.13: Permission denied (publickey).
You cannot use the id_rsa file created on Windows (cmd.exe) from WSL due to too much permissions.
Open or Create the C:\\Users\user\.ssh\config file on Windows and enter the following lines:
Host nahcnuj.local
HostName nahcnuj.local
User nahcnuj
IdentityFile ~/.ssh/id_rsa
On Windows:
C:\Users\user>ssh nahcnuj.localLinux nahcnuj 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7lThe programs included with the Debian GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.Last login: Fri Apr 24 22:30:02 2020 from 192.168.0.12nahcnuj@nahcnuj:~ $ exitlogoutConnection to nahcnuj.local closed.
Change the configure of RLogin
サーバー接続
Select the entry created above
編集
SSH認証鍵
Select the SSH private key created above
Linux nahcnuj 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7lThe programs included with the Debian GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.Last login: Fri Apr 24 22:38:03 2020 from fe80::a6:692d:9e6:cbc1%wlan0nahcnuj@nahcnuj:~ $
$ sudo crontab /etc/crontab
$ sudo crontab -l
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.SHELL=/bin/shPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# || .---------- day of month (1 - 31)
# ||| .------- month (1 - 12) OR jan,feb,mar,apr ...
# |||| .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |||||
# ***** user-name command to be executed17 * * * * root cd / && run-parts --report /etc/cron.hourly25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
Change the destination where Crontab outputs to /etc/log/cron.log
nahcnuj@nahcnuj:~ $ sudo service rsyslog restartnahcnuj@nahcnuj:~ $ sudo service rsyslog status● rsyslog.service - System Logging Service Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2020-04-26 00:36:52 JST; 6s ago...
# Set default values for all following accounts.
defaults
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
syslog on
aliases /etc/aliases
# gmail
account gmail
host smtp.gmail.com
port 587
from <your gmail address>
auth on
user <your gmail account>
password <application password>
# Set a default account
account default : gmail
Install mailutils to send e-mails
$ sudo apt install -y mailutils
Send an e-mail
$ echotest| mail -s "test subject" -a "From:Display Name <from@example.com>"'to@example.com'
Create a service file to start Gitea automatically
# wget 'https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service'
# vi gitea.service(Change username and group to gitea from git)
# mv /etc/systemd/system/gitea.service
# systemctl enable gitea
# systemctl start gitea