#unix
1 messages ยท Page 25 of 1
@grave jolt a switch, and a game cube adapter
Both have a male USB at the end, plugged into my laptop
test@LAPTOP-2RFK7PG7:~$ sudo apt install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip
how can I get this to work?
nvm I just had to do sudo apt-get update
hi i messed something up on debian in the ssh config file
and now ssh won't start :/
is there a way to fix that?
i can only connect in VNC now
which file? sshd_config?
@tribal cobalt just rename or remove the file and ssh will run with default settings
seriously?
let me test it.
It didn't work, why did you lie to me ๐ข @livid verge
root@nosklo.info:/etc/ssh# mv sshd_config sshd_config_backup
root@nosklo.info:/etc/ssh# invoke-rc.d ssh restart
ssh stop/waiting
ssh start/running
is that sshd_config file the file you messed up?
i think so
because you seem to have a different problem
What's the problem?
i mean, when i login to VNC, i get this...
not sure if it's related though...
yep, something else seems broken. Hard to fix without direct access to the machine; You might want to ask on #debian irc channel
things are already somewhat broken, so I can't give safe advice
Go ahead I guess, worst that can happen is having to reinstall
<@&267628507062992896>
what
if i reinstall SSH on debian it won't delete my files right?
i have files in /home/rabbit
and /etc
!warn @tribal cobalt Pinging admins is for programming help is not it's purpose, it's for requirement of administrator action. There is no express help because you ping.
:incoming_envelope: :ok_hand: warned @tribal cobalt (Pinging admins is for programming help is not it's purpose, it's for requirement of administrator action. There is no express help because you ping.).
That's not in the rules...
Sorry then, just upset i have to reset my server because i can't reinstall SSH
there's no reason why reinstalling ssh would "delete your files" , no.
What Would It Change
It would delete ssh
@tribal cobalt whats the issue you are having? Id suggest we should start there
@tribal cobalt you were in here yesterday (as @gilded sparrow if anyone wants to check the history) asking for some issue with the uname showing up on login - you said that the 10-uname file was empty, which seemed unlikely. Is it possible that whatever you did to look at the file deleted the contents?
anyway at this point probably just delete 10-uname
@gritty stirrup could you please help me fix this chat error
it's a consistent error. you fix it, but after a couple of messages, it happens again. something to do with the logs i suppose. can you just fix it for me and i won't have to trouble you again.
3
7h
I'm going through these instructions for setting this environment up : https://medium.com/@k_efth/deep-learning-in-arch-linux-from-start-to-finish-with-pytorch-tensorflow-nvidia-cuda-9a873c2252ed
but around this line at the end
https://gyazo.com/d65f7d20de7c2709722b4a5be254859f
nvidia-xconfig
im getting an error
https://gyazo.com/327675eb28dda156d13cf35c33f6d273
New X configuration file written to '/etc/X11/xorg.conf' ```
Guys
Help
I Used The "who" Command And It's Showing "Weeb" As Online
3 Times
When Only 1 Session On Weeb Is Running
@stiff tiger that isn't an error.
Anyone Know How To Fix This
File "/etc/chatt/run.py", line 3, in <module>
from database import query, modify
File "/etc/chatt/database/query.py", line 3, in <module>
from utils import DATA
File "/etc/chatt/utils.py", line 20, in <module>
with open("config.json", "r") as file:
PermissionError: [Errno 13] Permission denied: 'config.json'
chmod +r config.json
It looks for the file in the current working directory
Not necessarily where the script file is
@tribal cobalt , the two errors you pasted are different
if you've solved the first error, you can add absolute path to the config.json file
but it's weird if it doesn't work, if you haven't change anything else
@warped nimbus both files are in the same directory.
how do i make it not look for the current working directory then?
Specify an absolute path to the file
Or just cd into the directory before you run the script
That's not possible
the user is already in a python script. when they type a custom command like "chat", the python script searches for python /etc/chat/run.py
so i need to add something to that script but idk what, any ideas?
Then edit the script to have an absolute path to the config
how?
To start, the error already tells you which file and the exact line the error is on
So go there
Then edit "config.json" to be the full path instead
what's the line that does that
like "/etc/blah/config.json"
No you edit the Python script
I just explained how
you never gave me the line
You just need to edit the path given to open()
The python file which loads config.json, which couldn't find config.json, and raised an error ... is listed in your traceback you pasted. It includes a line number too.
I told you, the line is shown in the error message
It gives you the exact path to the Python file
and tells you the line number
Use the bottom-most part of the traceback, not the top
What Do You Mean By That?
When you read the error, the bottom of it is where the error occurred. Everything above is the code that lead to the erroneous line
the error is open("config.json", "r") ?
Yes
Just gotta edit the "config.json" part
and change it to open("config.json") ?
No it needs to be the full path
"/etc/chatt/config.json" or whatever the correct path is, IDK
ok
@tribal cobalt , which os are you using?
Debian
absolute path on linux starts with /
if you know where the config.json is located
cd into that directory, use pwd
@warped nimbus
what pwd returns + config.json is absolute path to the file
Probably best to move to a normal help channel as this hasn't really pertained to unix in a while
just state your problem there and someone will help out
yeah, I was having trouble finding this thread :)
does anyone know why my screen might be going blank and unresponsive when i lock the screen?
i think it stays that way until it goes into a further power saving state like sleep
its possible that your lock screen is using different settings for your monitor that it doesnt support
hm. whats weird is, when i boot into debian the lock screen works fine
so i dont think thats it? i found a forum thread that offered a solution but i was afraid to try for fear of locking up my computer for 15 mins
also the person in the thread said none of it worked
they suggest a bunch of incantations i dont understand
boot in to debian as opposed to booting in to what?
how do I use ls to list full filepaths
in a directory
I tried to cat multiple files.. it didn't work v.v
files too large apparently
cat together multiple files into one I mean
oops.. got it.. apparently I didn't supply the path and it redirected output to where it couldn't be saved as such a large file
How To Disable Specific Characters?
Eg Atm Up Arrow = ^[[A
I Want To Ignore That Key.
On My VPS, I Only Want Letters To Be Accepted To Type In The Terminal
is it possible to open a file picker from the python program? it will be quicker than typing the file location!
subprocess should be able
@tribal cobalt i did post something in #help-coconut for you that you may be able to adapt or use for the issue
you could probably modify it to fit your needs
hey so does os.system not play sound or something?
I have this script and when I run it I don't get the screenshot sound like normal
import sys
import os
import datetime
_folder = "~/Pictures/screenshots"
filename = datetime.datetime.now().strftime("Screenshot %Y-%m-%d %H:%M:%S.png")
path = _folder + "/\"" + filename + "\""
args = ""
for arg in sys.argv[1:]:
args = args + " " + arg
command = "gnome-screenshot -f " + path + "" + args
os.system(command)
more about it here if it might be helpful somehow https://ptb.discordapp.com/channels/267624335836053506/303906514266226689/581867069574873093
OS is ubuntu 19.04 with GNOME 3.32.1
@tribal cobalt PATH is a variable in unix systems that tells the shell where to find binaries
like when you run ls, or cat, the shell looks in PATH, finds the /bin directory, and sees that /bin/ls or /bin/cat exists, and executes those binaries
Ok
The executable you're trying to run, sl, exists in /usr/games, which should already be in your $PATH variable
Ok
So you could try just typing sl into your shell
bash: sl: command not found
okay, in that case you'll have to add /usr/games to your $PATH using export PATH=$PATH:/usr/games
If you want this to happen automatically when you start bash, add it to your ~/.bashrc
@velvet pilot os.system might not be passing an environment to gnomescreenshot. you might look in to the shell parameter or using subprocess instead.
you also might switch to subprocess just so that you can capture the stdout and stderr
I don't really care about stdout and stderr, sending them through the console is fine
since this is supposed to be called by a keyboard shortcut
you can use it to make sure gnome screenshot output exactly what you wanted, you dont have to show it to the end user
eg nothing if thats what it does when it works
the thing is that the only end user is me and I don't plan on seeing it anyways
however its likely that if you dont run gnome-screenshot in a shell or other system for passing in an environment, it wont be able to find a ton of stuff
so I really don't care
seeing what? I'm just talking about error checking
seeing the output
sorry, i didnt mean show the output ever. I just meant you can check in your program that the output of gnome-screenshot is what you expected so that if it fails you can notify the user. otherwise when it fails you are just going to get nothing if you bound it to a key
so I changed it to subprocess.call(command, shell=True) and it still doesn't make the sound
to know why, you prob need to check the output of gnome-screenshot's stdout and stderr
even if its just for debugging right now
there is nothing in either of them
it works otherwise than the noise
it just doesn't make the sound it should
can you use subproccess etc to run pulse audio cli tools without error? eg like pactl
can you give an example command I could try?
i think pactl set-sink-volume 0 20% would adjust your volume to 20%
no output in stdout or stderr and it sets the volume
hmm not sure why its not making sound then. i peeked in the gnome-screenshot source and it doesnt seem to have any thing that would check if its in a terminal.
potential things to look in to it uses some sort of generic name for sounds that are defined by XDG and it uses libcanberra to play them, so maybe somehow thats not getting the env it needs
os.system("gnome-screenshot") makes a sound for me
and env -i DISPLAY=$DISPLAY gnome-screenshot does too, so it doesn't necessarily need anything but the DISPLAY variable to run
when I do the second one from my terminal it spits out a bunch of errors about perms and segfaults
oh weird
os.system("gnome-screenshot") makes the sound in interactive
huh, and if I have a file that just does that
weird, apparently gnome-screenshot doesn't make a sound when you run it with -f
if i have an vps, how can i make code to run 24/7 ? i want to close the ssh client and pc
unbutu 16.04
whats the best thing to start with python 3? where can i start
i already know the very basic things
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-screen-on-an-ubuntu-cloud-server is what i meant @main olive or set as a cron job
No, you probably want to create a service/startup script
Cause you don't want to run it manually
systemd service is what you want for stuff that runs automatically and all the time in background
as service? or in screen?
screen
i do
screen
python3.7 script
and i want to close it
and when i start vps
i do
ctrl a "
and i don`t find
the script to close
ah, I never really use screen personally
To kill the screen there's a command-line switch for the screen command which I can't remember right now...
Does screen -ls show any sessions?
Had to look it up since I can't remember
All that does is restore the session and then leave it again
If you want to kill the session use the screen -XS session# quit command
guys what is enter key and space key in unix
because i have a python script to detect words, but what do i type for the enter key and space key?
like ctrl c is ^C
what do i put for enter and space keys
can we see some code?
we have no idea what you are looking for by "enter and space key"
we need to know how you are handling other things @tribal cobalt
sure
@rustic sky
print('This command is not allowed')```
i need one for ctrl c, SPACE key, and enter key
but i don't know what to put
where is comm coming from
wdym
where is comm defined
except: comm = "lol"```
you can't catch ctrl+c, space or enter with raw_input
what is your use case? what are you making?
i am making a kind of restricted shell
that only specific commands can be run
but it's buggy with the ctrl key
users can simply just exit out of the script or even just make it not recognise their commands anymore
you can't catch control characters with an input.
what would i use?
It's a lot more complex
:/
you have to disable echo in the tty options for spaces so you get every character and then you'll have to write some sort of buffer system to handle commands
it'll mean you have to handle all control of the shell
ok so general advice here don't run commands from the internet unless you understand what they do
because i made this and it's not saving logs, so he's helping me
isFirstTimeRun = input("Is this the very first time you run this script? Enter $
if (isFirstTimeRun == 'y'):
print('Downloading and installing sysdig package')
os.system('curl -s https://s3.amazonaws.com/download.draios.com/stable/inst$
os.mknod('/.serverlog')
if (isFirstTimeRun == 'n'):
os.system('cd /')
print('writing logs to: /.serverlog')
os.system('sysdig -c spy_users >> .serverlog')
os.system("tail -f /var/log/auth.log | grep 'sshd' >> .serverlog")
what is this script for?
spy_users?
top is not going to be useful
this seems a little too dangerous to help with here, seems like it could be used for unsuspecting surveillance.
what are you even trying to achieve overall? what is all this stuff you asked the last couple days good for?
Its a ssh app server
I feel like you're either totally overcomplicating something, or completely underestimating the size of what you want to do
He wants to log all the users that use it
o o f k
yea XD
there's already a log in the chat silly
this is for users who connect and disconnect form the vps
but i don't trust the person who is "helping" me
he knows i'm a noob
sshd already has logs
Yes. you log in, and it loads the terminal app up
ssh
sshd = ssh in this case
why would you give people access to your vps who you don't trust?
as soon as someone connects to my vps, i wanna see it.
sshd can do that for you
@oak shell because i have a python script that only lets them do specific commands
how joe?
that will most likely fail
you already have it in your code.
yes not working
yes because you don't understand what it is doing
making a sandbox is hard, making a sandbox that is safe is harder
you are re-implementing things in an unsafe way
i should just install honeypot right?
what
if you dont trust them dont let them on the system.
cant you just whitelist commands by only giving them +x access to a symlinked bin directory?
and im sure theres better and/or more complicated ways to implement, but what riff said is correct
what do people do for SSH keys? do you have one per client-device/host-device pair? or one per client? or one per host?
or one key to rule them all ๐
Depends on your security posture. A lot of people have one key to rule them all
hmm ok
technically key reuse is like password reuse, if your key gets leaked somewhere for whatever reason, people get access to everything the key is used for
so it's IMO okay to reuse one key within the same infrastructure, e.g. if you have a cluster of equivalent machines where having access to one is just as bad as having access to all of them
otherwise, for different and unrelated services like a VPS and your GitHub, it's better to separate them
you can specify in your ssh config which key to use for which host
If you're directly using ssh or you can influence what flags are sent to it, you can also specify the exact key using -i command-line parameter.
If you're interested in being secure, there's a ton of things to consider for ssh, including and especially whether or not you have agent forwarding or X11 forwarding enabled
right, I've been using diff keys for diff clusters of services so far
I think I'll stick to that and consolidate access to a couple groups maybe
quick question: is there a quick way to test ssh transfer speeds?
iperf3 with port forwarding is pretty quick
depending on the port forwarding direction, you'll need to pass either -R or -L to ssh options. Or look at PortForwardRemoteForward or LocalForward ssh_config options
cool, will take a look. thanks!
lol i also have a question about ssh and port forwarding
i set up port forwarding for a port and added it to the sshd_config file, then reloaded the ssh service
but i cant connect to ssh from the forwarded port
i tested the port forwarding on the external port with https://www.yougetsignal.com/tools/open-ports/ and it works, and ive tested sshing into the machine on the local network using the new internal port and that works, but i cant ssh through the forwarded port into the new port
The port forwarding tester is a utility used to identify your external IP address and detect open ports on your connection. This tool is useful for finding out if your port forwarding is setup correctly or if your server applications are being blocked by a firewall.
this is raspbian on raspberry pi
@odd hollow I'm not sure I understand
port forwarding works
ssh to a port other than 22 works
port forwarding to the new ssh port does not work
Again, I'm not sure I understand. You say "port forwarding works" and then you say it does not work. What are you doing? What do you want to do which isn't working?
forwarding to the ssh port and then trying to ssh through it does not work, but i know that the port forwarding itself is working because i tested it with https://www.yougetsignal.com/tools/open-ports/
The port forwarding tester is a utility used to identify your external IP address and detect open ports on your connection. This tool is useful for finding out if your port forwarding is setup correctly or if your server applications are being blocked by a firewall.
How are you forwarding the port?
upnp's igd-pcp
i got a 200 from the igd
and it lists the mappings correctly when i request them
Ahh there's the confusion. You're not forwarding via ssh. I don't know how upnp works: I disable upnp on my network.
ssh is over tcp right?
Yes.
i forwarded tcp
k. that doesn't mean you're forwarding via ssh.
oh
that just means that some other service, I assume your router, is doing the forwarding
yeah im forwarding from my router to my computer
you probably have a firewall rule somewhere that blocks port 22
its not on 22
i put it on 2222
well externally its something like 63xxx and then internally its 2222
in the sshd_config you set ListenAddress :2222 and restarted the ssh daemon/service?
um i did Port 2222 i think
see man sshd_config, you need to set ListenAddress
although I guess Port is documented too, but I've always used ListenAddress since it's more explicit
and you probably still need to update your firewall configuration
@shut harbor you do any stuff with WSL?
looking into which distribution to use so I can use rllib
Unfortunately no @analog hornet
RIP, that's unfortunate
Iโm looking for a Linux distribution to use in conjunction with WSL to download and use some python machine learning packages. are there any recommendations here outside of Ubuntu or Debian
Xubuntu
Arch/manjaro maybe?
hi
when i login to SSH debian
it says login as: and (IP) password:
i'd like to change it to Username: and Password:
how do i do this
completely unrelated to python
those prompts are part of your ssh client, not the server
So you're saying no to my wrapper idea then
I am testing out different Linux distros right now
I tried Ubuntu, and I am thinking of trying Fedora
How do I figure out what is the best distro for my use case?
Right now Fedora is on a bootable USB stick right now, but it doesn't seem to want to boot.
Everytime I restart, it just brings me back to Ubuntu.
I used Rufus to write Fedora onto the USB stick.
What am I doing wrong? Am I supposed to hold down F2 or something?
did you compare the hash sums of the downloaded iso before flashing it?
No, how do I do that?
also is the boot order in BIOS correct (USB before HDD)? Alternatively there might be a manual boot device selection menu that doesn't change the settings but is just for once
on Ubuntu, you can just type e.g md5sum /PATH/TO/DOWNLOADED/FILE.iso to compute the file's hash
or sha256sum is what you need in this case
because that is what they provide in https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Silverblue/x86_64/iso/Fedora-Silverblue-Rawhide-x86_64-20190524.n.1-CHECKSUM
# Fedora-Silverblue-ostree-x86_64-Rawhide-20190524.n.1.iso: 2256076800 bytes
SHA256 (Fedora-Silverblue-ostree-x86_64-Rawhide-20190524.n.1.iso) = c03640c46391c68068b863bea8d2879c3ac2f81158e2959843c265f57cc6a54c
the output should be the same long alphanumeric string like there (c036.......a54c)
if it is different, the iso file got corrupted during the download and you have to download it again
well uhh
you see
I wrote it on a different computer
How do I check the sum on a windows computer?
I think you can use certutil...
ok... it seems to be working
c03640c46391c68068b863bea8d2879c3ac2f81158e2959843c265f57cc6a54c
c03640c46391c68068b863bea8d2879c3ac2f81158e2959843c265f57cc6a54c
yup
its fine
tis working
good, then it's probably the boot order
So what do I do?
you have to check that in your bios settings, or find a boot device menu outside these settings
How do I do so?
normally you have to press an F* key or DEL or something like that while the manufacturer logo shows up after turning it on
depends on your device
what if the manufacturer's logo doesn't show up
wait I got it
how do I change boot order from here?
no idea, each of these setup menus looks different
normally there's a menu labeled boot or something
there is
and in there a submenu about boot device order
there you have to make sure that whatever your usb stick gets identified as is before your internal hard disk
with:
Boot Mode [UEFI]
Fast Boot [Enabled]
USB Boot [Enabled]
PXE Boot to LAN [Enabled]
IPV4 PXE First [Enabled]
EFI
Linpus lite (Patriot Memory {the name of my usb boot stick})
can you select the usb stick and do something with it?
๐คท dunno then
fast boot says "sets the BIOS to boot only from a built-in HDD (SSD)"
should I disable that?
yeah, try disabling it
uhh
oh thingy
new menu
Install Fedora Rawhide
Test this media & install Fedora Rawhide
Troubleshooting -->
prolly test
well there was imeediately an error for the first few lines
but it seems to have worked anyways
btw rawhide is the test branch
whats that thing called..
where you can run commands and resume when you want to
tmux
yeah
got it
You can also use screen
^
i know rawhide is the test branch
Now I want to try the normal branch
so I rewrote it
using the FedoraMediaWriter and stuff
plugged it in
restarted
and... it did not open the installer again
You need to tell it to boot the usb stick in the bios.
You can get there using systemctl reboot --firmware-setup
oh thanks
ima try that
Cannot indicate to EFI to boot into setup mode: Access denied
I tried sudo
if that doesn't work you'll just have to do it the old way.
Pressing a button during boot.
Yes
Boot Mode [UEFI]
Fast Boot [Disabled]
USB Boot [Enabled]
PXE Boot to LAN [Enabled]
IPV4 PXE First [Enabled]
EFI
Fedora (SAMSUNG MZVLW128HEGR-000L2)
Fedora (SAMSUNG MZVLW128HEGR-000L2)
If your usb stick isn't seen there you might need to reinstall the usb
your system doens't seem to recognize it as something bootable though
Yeah, what are you using to write it.
fedora media writer
That should be fine
2 million kb
and uhh shoot
right
d00e9a77623faa5504537d63e4d4a1767dcd3e162fdfdced7ebc6cb1aac14936
d00e9a77623faa5504537d63e4d4a1767dcd3e162fdfdced7ebc6cb1aac14936
well its good
so it should work now
ok
my pc is powered off
I plugged it in
im going to power it off
do I need to f2 or no?
go to the boot menu yeah
select the usb from the menu and boot it
I cant select it
it just flashes if I hit enter
like its loaded something
and then nothing happens
I'm not sure how to go from there.
maybe its like
it loads
and then I exit
like it doesnt exit automatically or soemthing
should I exi?
where are you now?
And is the usb visible?
Can you select it?
it did a little flash
is there a button that says boot override?
These things all look a little different from eachother
I wanted to copy a directory to another..
just did cp and didn't work.. until I added -R
what gives?
The -r flag tells the file system to recursively roll down the file/directory tree and copy any & all contents that might be a โchildโ of that file to a new place.
@main olive man <command> takes you to the man page (manual), and is very helpful for understanding flags
to search for flags in the man page, in cases where there are a bajillion flags, press / then type the thing you want to search for
if there are multiple matches, n moves the cursor to the next match, and shift+n moves it to the previous match
I read the man.. it said recursively search .. I thought it was for subdirectories and not files
presumed that cp would copy entire directory without the -R
why do online man pages look so bad
where does the /tmp reside
is it like temporary folders on windows..
/tmp is the absolute path
according to the Linux FHS, https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard:
/tmp - Temporary files (see also /var/tmp). Often not preserved between system reboots, and may be severely size restricted.
/var/tmp - Temporary files to be preserved between reboots.
ooooh cool cool
How could a file descriptor be created in Python and then shared with another process e.g. via subprocess?
My basic understanding of fds is that each process has its own fds
os.set_inheritable looks promising
or doing some hacky shit like getting the pid of python and using proc/pid/fd rather than /dev/fd
I have to use subprocess cause I need to capture stdout and stderr from the process
but the process is a tool that has some options for specifying a file descriptor for logging
Anyway I may be onto something with Popen's pass_fds
Well I got the fds to show up in the child process but it fails to write anything to them
you can get the file descriptor from IO objects using .fileno(), would that help?
with open("test.txt", "r") as f:
print(f.fileno())
That was like one of the first things I tried
Thing is I didn't want to create a file
so I use os.pipe()
Here's my current code ```py
import subprocess as sp
import os
r, w = os.pipe()
os.set_inheritable(r, True)
os.set_inheritable(w, True)
p = sp.Popen(
["nsjail", "--log_fd", str(w), "--", "ls", "/dev/fd"],
# ["ls", "/dev/fd"],
text=True,
stdout=sp.PIPE,
stderr=sp.PIPE,
pass_fds=(r, w)
)
stdout, stderr = p.communicate()
print(stdout)
print(stderr)
print(p.returncode)
with os.fdopen(w, "w") as log:
log.write("fuck")
with os.fdopen(r, "r") as log:
print(log.read())
At this point idk how to debug it since it's interacting with a completely different program
and it's especially hard since I break that program's logging by specifying the log_fd
all I get is a return code to work with now
I could just give up and create a temp file to log to...
Hey, are there programms which can restart other programs when they crash?
Other program = Python Script
Nobody can help?
I don't think a program can do anything except close when it crashes
Although you could have kinda like a daemon to see if a program closes unexpectedly and do stuff
Depends on the nature of "crash".
But yeath, the most straightforward is just keep python script running and checking if your program of interest is running, then restart if it doesn't.
Basically, that's what http://supervisord.org/ does. And it's written in Python. @solar garden .
Thanks. I'm searching for something like pm2 for node.js
Never used that one, but supervisord did rather well for me until I switched to docker.
Thin layer of virtualization technology.
Pretty powerful stuff for production deployments.
And for local development, for that matter. But is fairly in-depth.
OK, don't think that I'll need this
@solar garden if you are on a distro running systemd, it supports restarting services automatically if they fail. Its not a bad idea to use the os's service management in general when you can
That's late, but thanks!
ssh user@ip
not all users in passwd have passwords defined
some users can also be restrained from logging in in multiple ways
setting the shell to /bin/false is a common way
You are using a gui?
yea
I thought you were using terminal
I am out
but i hopped over to putty and it doesnt allow me to ssh using root user
Access denied?
the sshd config has a setting to explicitly disable logging in as root
check the logs on the server
you can also use ssh -v or ssh -vv to get more details about what stage its failing on
Also, ssh might not work if you have router settings blocking that kind of connection
hmph i've already changed permitrootlogin to yes
the transferring ssh keys to the vm screen makes it sound like a server side issue. if they dont have a home dir for example then maybe it could fail
i would def check the logs
looks like the permissions and owner settings on the ~/.ssh files is wrong
you need to make them owned by that user, also grouped in to that users specific group, then you can set most of the files to i think rw for the user and nothing for all other users
so group / other would have no permissions
and thats the folder and each file i think too
technically some of the files can have more relaxed permissions but that should be an easy enough fix
from the ubuntu wiki:
chmod go-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys```
Yeah if you can log in as that user / use su to switch to them somehow then you can run those settings. Otherwise as root you would have to specify the exact path instead of using ~
Yeah you have to either be root or that user
but how do i log on as that user? @grave jolt previously, i used ssh gui through google cloud and there wasn't any issue on the first login but not able to do so on the subsequent logins
Note to self: Don't use google cloud services, they seem like a pain
indeed they are... 
I'm trying to use WSL to download / use packages with python. Should I be running python out of the debian install or am I still running it off the windows installation?
Any professional Linux Administrators around? Are you using Python to automate things? Do you prefer bash? Or a combination of both? Would love to hear your professional experiences. Reason I ask is, because I am starting a new job as Linux Administrator in July, where I am supposed to automate the server landscape of that company and I am thinking about a strategy. I would tend to use only bash scripts, because it is native, but then, Python can be a great tool.
echo 'a' > a
echo 'b' > b
echo 'c' > c
echo 'd' > d
tar -c -f ab.tar.gz a b
tar -c -f cd.tar.gz c d
tar -c -f abcd.tar.gz ab.tar.gz cd.tar.gz
tar -x -O -f abcd.tar.gz | tar -x ab.tar.gz
why does this give me an error saying ab.tar.gz isn't in the archive? i would expect that it extracts the files a and b from ab.tar.gz
@frozen summit if you can access root you can use the su command to log in to a specific user. eg su - usernamehere the - by itself tells it to switch your environmental variables like HOME too I believe.
@formal schooner
tar -x -O -f abcd.tar.gz | tar -t
a
b```
that shows a and b are indeed in the file however you do: `tar -x ab.tar.gz` which tells it to extract ab.tar.gz from that archive, which has only a and b in it
leave off ab.tar.gz and just have `tar -x` and it extracts 'a' and 'b'
thats confusing because tar -x -f abcd.tar.gz does indeed extract ab.tar.gz and bc.tar.gz
at least in my testing it did
oh
hold on.... is tar -t just processing the first tar file that it gets on stdin?
so tar -x -O -f abcd.tar.gz pushes out 2 concatenated tar files, right?
but when that's piped back into tar, it's only processing the first?
Ah yeah that's prob what's happening. It reads the first header and then just considers itself done
You'd prob need to loop over the list of files and extract each one individually
Loop over abcd.tar.gz's files
@steel verge My non professional opinion is that bash is very cumbersome to use for any script of significant size
@steel verge I would switch to things like ansible/chef/puppet for sure. you should almost never need to write a whole bash script for just normal operations imo.
@cosmic brook Just post your question here, don't ask to ask...
Okay, later.
Any Solution?
@tribal cobalt Have you taken a look into your .bashrc?
Yes there's nothing in there, it seems to be on every user.
so it's absolutely empty? I doubt it tbh
.bashrc is what is executed after a login
try to move it to a different name and see if it pops up again
and .profile
And if ~/.bash_profile exists, it overrides .profile. So those are the files you need to search for an answer
is it always the same number?
Hi! I have a problem with python3.6/3.7, my command is:
# python3 discord.py
And i have error:
Traceback (most recent call last):
File "discord.py", line 1, in <module>
import discord
File "/home/fsmil/fServer/bot/discord.py", line 2, in <module>
from discord.ext import commands
ModuleNotFoundError: No module named 'discord.ext'; 'discord' is not a package
And i have installed module with command:
# pip3 install discord.py
# pip3 install discord
You can't name your file discord.py
Because module import is given preference to files in the current directory
Okay, try...
Real work, thnk's you!
But I still have this error with telegram bot.
(file name: bot.py)
@zinc bobcat, you can help?
@steel verge It Has Nothing To Do With Bashrc
Why doesn't this work?
@main olive That's within a python repl
You can't run commands inside there
Only python code
>>> means it is python shell
Wonderful
I primarily use Python3
I had to use Py2 recently because it has the ScrolledText module, plus other stuff
Does pip include modules, or is it just for downloading modules?
pip is a tool for installing modules
not really
well you can if you want to install modules for all users
and for the whole system
Don't run it as root unless something really requires it.
^^
Anyone know why matplotlib might not be installing properly? It crashed my pi the first time, now it's just stuck on "using cached "http....."
so emojis
Fedora works and I love it
but emojis
on Windows its fine
but the emojis load weird here
like some emojis look nothing like before
how do I set the emojis used?
how do I get started with linux?
Download PuTTY (https://www.putty.org/)
Then go through some of Bandit: http://overthewire.org/wargames/bandit/
Then install Ubuntu (or Mint, up to you) ๐
There are also a lot of good YouTube tutorials out there
Modern linux distributions ("distros") have good or great graphical user interfaces (GUIs), so you can install Ubuntu, Mint, Fedora, etc. and it'll feel a lot like Windows
If you want to unlock the true power and level up as a developer, though, you'll need to start learning terminal commands
Corey Schafer has a bunch of videos
you can skip the mac ones..
@floral dove have a look at e.g. https://linuxjourney.com/
that covers the basic of many foundational topics that you might need to administrate a Linux machine, including servers
For desktop usage, depends on the DE you pick, but that part is mostly intuitive.
I use Mint, it is good for everyday use
However, there are better distros if you are a developer, IT, etc.
But for the most part, it is personal preference
on my vps, i wanna make sure there's no way a user can see the files on my vps, but i only know of a few protocols, like sftp, scp, etc... i want you to disable every single one so there's 0% chance the users can't see files on my server
is this possible?
Setup a firewall and block everything except the things you need
Iirc udp is one of them
Ok
UFW, my mistake
i'm using rbash as a restricted shell, how do i change the location of it and put the commands i want the user to be able to use in a /bin directory?
Choosing for yourself? Windows is pretty good these days, especially with Windows Subsystem for Linux
Price is one factor
linux is free ๐
Windows is affordable and works easily with most consumer hardware you put together
macOS requires Apple only products, which are pricey
@umbral cargo How did you make your user sudo?
usermod -aG sudo username
Switched to user then by running su - username, checked if I was root, & it worked out
But now I can't SSH

Did you name your group sudo?
Oh nvm
It's the file that's called sudoers not the group I believe
I can't think of what could have gone wrong by simply adding a user to a group 
Can you post your /etc/sshd_config file?
That would be /etc/ssh/sshd_config actually
Yeah that
Ahh I figured it out either way, anyways ty for the help 
By figuring it out, it means I switched to root & edited directory & sub folder perms to allow my main user to write to them, instead of actually figuring it out, but too pre-occupied with my current program to try & bother figuring it out
Which directories? The one with the ssh keys?
The user you're trying to log in as should own that directory
And you shouldn't be sharing root ssh keys with other users, if that's what your solution was
The most important thing to know about password-less ssh is, that ~/.ssh can't have group permissions. So if you add a group to your user, it might add group permissions to your home directory recursively and then you can't ssh anymore. The most anal are actually Synology NAS. I had to chmod 700 the whole ~ directory before passwordless would work.
i'm trying to change the path variable to a user so when they login, only specific commands i set can be run... how do i do this?
? Please don't "arbitrarily" ping helpers
sorry.
that is actually a very hard question in security
probably the easiest way is to not change the path variable (or otherwise try to restrict things on that end with a normal shell - changing the path won't work but a chroot could in theory), instead create a custom login shell for them
i can't walk you through that now thouh
I'm trying to create new files for jupyter3 notebooks on WSL. I'm getting: An error occurred while creating a new notebook.
Permission denied: Untitled.ipynb
This is coming after creating a new notebook in localhost:8888
i'm trying to change the path variable for a user on my debain vps, so when they login, only specific commands i set can be run on the restricted shell... how do i do this?
i was thinking of using rbash, but even still, there's commands that a user can use to escalate.
path cant do that, they can just edit their own path or directly execute the commands.
you need a chroot at minimum or container ideally
Are there disadvantages to installing full blown Debian on an rpi
afaik it doesnt run on an RPi without patches
unless they changed that
looks like they did, but it still has issues
afaik there is no advantage to not using raspbian
Use Yocto ;3
Hi guys, im doing a opencv project using the rasp-pi and i need more control over cpu time
Disabling desktop environment helped a ton
Im wondering what more i can do
Youtube videos wont load, I am on Fedora 30 Workstation
Its confusing, if I look online its only firefox, and none of the answers work
if I hit the little htm5, it says my browser is up to date and theres nothing that needs to be done
if I look in software for this one gstreamer package, it isnt installed
but if I try to download it I get first a popup telling me to enable third party repos
then afterwards, trying to download says "this repo is already enabled" and it wont download
@marble sentinel Try a lighter distro. Or is that what you already did when you disabled the desktop environment?
Well, the thing is i have no idea what kind of 'OS dependencies' my code has
For example the images are beeing processed on the pi's GPU, I'm also calling picamera functions
No idea what I'd need installed to make sure that works
Im running headless stretch
Usually docs tell you what dependencies are needed. Also, the errors may be descriptive enough
But honestly idk how much CPU you'd save anyway
You save disk space more than anything else
Just with a lighter distro there's less shit running
But you could configure what you have yourself too I suppose, it just seems like more work
What I mean is disable unneeded running services and other processes
Play around with groups to limit cpu usage for other processes
Just throwing out some ideas
Alright thanks @warped nimbus
Will test stopping some stuff see if it breaks anything ๐
Or just try to change priorities
Also consider reducing your program's nice
Oh just noticed: I meant cgroups not groups
I don't think cgroup hard-limiting processes is very useful on a desktop, adjusting niceness for less important things would be preferable imo
that allows them to still make use of all available resources but lets the scheduler give them less priority if the system is under load
define "really cool"
not nromal
i guess
and you make yours look cool by using the config files at your disposal
for example you can configure bash with .bashrc
zsh with .zshrc etc
and if you want to go like Really fancy youd also have to stick to configs of your desktop or even window manager + your terminal emulator
A common addition is powerline-shell
Also look up various terminal emulators
They each have their own theme configurations
The folk on unixporn may look impressive but their workspaces are just pretty
Focus on improving your workflow rather than looking cool
to expand on that, focus on getting your workflow working the way you want before focusing on getting it to look the way you want
coming from windows
emojis look really weird on fedora
how do i set an emoji font per say
so people
ive installed kali linux on my compute
and i wanted to install windows back
is there any option how i am able to do this
Do you still have the key?
the problem right now is making a bootable windows usb
The windows site will let you download iso's.
Which you can dd onto a thumb drive.
Why wouldn't it?
because as far as I know, Windows needs special treatment and just flashing the iso as-is does not work
i already tried to do dd
and has also been tried ^
the usb ive got now does at least anything
didn't do anything?
it shows me a blue screen with an error about windows installation
uh?
if you dd the image and then set the boot order properly
it should not continue to boot Kali
ill try another time
do you get any specific error, or does it just say "error about windows installation"?
how about you try right now?
from what you said your only computer runs an OS that is not meant to be used for your only computer
dd pathtoISO pathtodisk
maybe i did it the last time wrong
what did you do last time
if= and of= preferred
o yes
i just copied some code from a website changed to my windows iso and thats it
and how bout the sync?
and the bs=4M
that's fine
sdb, that's the whole stick (Assuming that really is the usb, if not you'll lose data on something else) sdb1 is a partition on sdb
make sure you're looking at the correct device. look closely at the total sizes
we have no idea
no look
i put the usb in
and look carefully
and put out
there are 3 files poppin in
okay
you know the dev file
there are the usb's displayed
if i put my stick into my computer
i'm just saying you should be sure which device is which, because one device is your laptop's internal HDD, one is the usb.
if you dd to the wrong device, you could be out a laptop
out a laptop temporarily
could be saved by finding a device to use to get a bootable USB
maybe a local pc shop has a windows install usb
still don't know what "pop into" means
lsblk lists all devices. Examine that output
sda 8:0 0 238.5G 0 disk
โโsda1 8:1 0 230.6G 0 part /
โโsda2 8:2 0 1K 0 part
โโsda5 8:5 0 7.9G 0 part [SWAP]
sdb 8:16 1 14.6G 0 disk
โโsdb1 8:17 1 14.5G 0 part /media/peter/MKDB
"hey can I borrow a PC and come back like tomorrow I promise I'll come back"
okay, so sdb is your USB
on sdb we see a 16GB drive
on sda we see 250GB and three partitions that look suspiciously like an EFI partition, swap space and a Linux install
wait, you have 8GB of swap?
..nevermind
well i dont understand what you mean by swapping
it doesn't matter
you have an 8GB swap partition and that's kind of a lot of swap
but it doesn't matter
you're not going to be needing that
you should be able to
dd if=/path/to/windows/iso of=/dev/sdb
alright thanks
dd /Downloads/Win10_1903_V1_Dutch_x64.iso of=/dev/sdb
dd: unrecognized operand โ/Downloads/Win10_1903_V1_Dutch_x64.isoโ
you did not write what I wrote
if= and /Downloads probably doesn't exist
mistakes like that with commands as powerful as dd can cost you your system, you really should be more careful with them
dd: failed to open '/Downloads/Win10_1903_V1_Dutch_x64.iso': No such file or directory
wait i did control c
to exit while he was creating the usb
can this harm my system
he renamed the usb
but the usb was empty
no, it just means you have to start again from the beginning
alright
you can add status=progress to the dd command line
that will make it show some status output while it is running
ill do that thanks
ev/sdb
9407812+0 records in
9407812+0 records out
4816799744 bytes (4.8 GB, 4.5 GiB) copied, 1429.96 s, 3.4 MB/s
but the folder is still empty
yea its inside usb
but
it didnt do anything
i restarted the computer
it just runs kali
nothing happens
theres this option inside disks
where you can choose a partition for your usb
which should it be?
@grand bane are you setting the boot priority correctly
oh, do you have a way of using Discord when the machine is off
yes
k
through my phone
so once you've done that there should be a "boot" menu or something similar
and then there'll be a list of things there
one should seem like it's a USB
maybe called a removable media
then you want to make sure it's at the top
wait i made a video
which shows how my pc starts up
i am uploading it
so within a few minutes you can take a look
?
i have an old windows xp laptop
dd didnt work
it doesnt recognize the usb
ive trouble transferring the video
becs its 120 mb
but can i do it with the windows xp laptop?
definitely
what should i do
i will erase the usb
wait lets begin by beginning
would you please explain how to erase the usb
in kali
or in windows
xp
how to erase a flashdrive?
Fast or secure?
Do you guys know how to install python 3.7.3 on linux mint?
apt get install python3 i guess
or maybe you can download a tar from their website
and extract inside your mint
yea i think you probably have to compile it from source
perhaps you can get pyenv to do that for you though
you should be able to use the deadsnakes PPA for Ubuntu, I guess
thank you for your response! apt-get oly has 3.7.1
@fist I did that, but if i wanted to remove it later on I won't be able to
does that make so much of a difference? what would you need specifically from 3.7.3?
you're not the first to call me fist lol
haha all good
@oak shell ordered dictionaries