#unix
1 messages · Page 24 of 1
Is there a boot order mentioned somewhere?
Only if I set uefi to legacy
Then it says boot order, legacy or uefi fiest
Oh in the Windows boot menu there a usb option, but it says "system doesn't have any usb boot option"
YOU HAVE GOTTA BE DUCKING JOKING
LMFAO
I made Ubuntu load, by literally unplugging and plugging in the usb drive
@vestal turret umm it says the pc has no detected is but it does I'm scared to erase my data, but idk what to do if I hit "something else"
I'm not sure, I use a different disk for every os
There's like partition tables and confusing stuff
Wait shit, how do I go back to windows
Same process as you did for booting into ubuntu.
The command in linux to reboot to bios is
sudo systemctl reboot --firmware-setup```
I didn't do anything to boot Linux all I did was restart
Oh lol I can just take out the usb
Lmao
Also what do you mean by different disc
hdd, ssd etc
No, you can have more than one hdd or ssd in your pc.
Huh
I have 2 ssds and 4 hdds atm
How
Just plug it into the motherboard, there is usually more than one connection for them.
Wait so
Oooih
Right pc not laptop
Forgot computers are 2 parts
How can I do that on a laptop?
Can you connect a pc to a laptop and have 2 computers
I do have 2 ssd's on my laptop, I took out the dvd drive to make room for one.
It's very intuitive, and just google if you can''t find something.
Okie
Uhh @vestal turret so I can install Linux but it says it will erase everything from all operating systems, but then proceeds to let me choose a drive, will it remove Windows?
I wouldn't risk it.
Be sure to have a backup no matter what.
Something everyone should have anyway but too many people don't.
But the only other choice is "something else" which is really confusing to go thru
How can I backup?
I used google to sync my files
It's too late for me atm, can't help with something that delicate rn
if you want to install multiple OSes you need either a dedicated disk partition or a dedicated disk
the partition will be reformatted, wiping anything that was on it
ok issues
I installed linux on another flash drive
but when I plug it in an restart it sorta works
it loads for a bit
but then gets stuck on a screen with a log
with a bunch of [ OK ]s on the left
and the last one was "started gnome display.ervice" or something
and it gets stuck ther
forever
Nope
its possible the video drivers are not compatible
stuff like this is why "the year of the linux desktop" is always current year+1
Does your laptop support optimus?
Hi, im trying to run this script but get an error and i really dont know why. Script & output: https://pastebin.com/smeEV5B2 - Simple "run these commands and save some text to a file". Whats going on?
did you write this on windows?
probably a CRLF line ending instead of LF
if thats the case you can run dos2unix to fix
@livid forge yup that worked! Thanks!
np
hey, im trying to host a webpage using nginx
but i dont know where to put my html file
in /etc/nginx?
Ya
Sites enabled
Is the any file in sites enabled
i copied my index.html and put it in there
No you don't put any HTML in the config folders
r i p
Is there any file in sites enabled
default
Open that
with vi default?
vim?
yeah
Have you learnt vim
yteah
Okay yeah any editor is fine
vim isnt installed
Or use less
yeah i opened it
Might not need to
index is index.html i just want to repalce it with mine
root /var/www/example.com;
i cna show yoiu
With root in it
SSL has root /var/www/html
That folder will probably work
i tried copying my index.html into the folder
You should be able to Chuck files in there
in /var/www/html
Ya
its already in there
i put my index.html in there
but it still shows the nginx one
Does it have right permissions for nginx to access as well?
i used sudo
Ya
does it work now?
You tell me
Or you can follow a guide on doing this as well you know
The are heaps
Did you visit /blah.html
That worked?
So at least directory and permissions are working
But sure about the index.html would need to debug more
*not sure
yeah as long as i get the page up should be fine
im trying to display some images using nginx but i cant get it to display
@regal mason Can I see your config?
whers that
is that the /etc/nginx/nginx.conf?
location /images/ {
}
is this what i add? @gritty stirrup
The way I do it, is have a subdomain
With all my images
And just make it's root option the images folder
i dont quite understand that
@regal mason https://code.mcadesigns.co.uk
Go to mcadesigns
And site.conf
That's my nginx config
Then look for i.mcaq.me
That's my image storage
Heres a example if it working
What are you actually trying to build?
serving a static webpage
just display some images depending on drop down menu using html
hosted on nginx
Like in the website?
yeah
Ok ... this is a #web-development question first then
You can't do this with NGINX
You need to use a programming lang
To put in the HTML code
?
Look into flask: that's how you do this with python
To display the images in your website, you need to code it
webpage wont load images
It can't see the files?
its like blank
Nginx has a root option
This is where it starts searching for data from
Anything outside of this will be impossible to see
so ihave to move the files into root?
No.
Nginx has a root option
In the config
You set root to where you want your stuff to be
And move everything you want to be seen there
where is the root folder in nginx
server {
location / {
root /data/www;
}
location /images/ {
root /data;
}
}
?
You see how you have a location option?
Just look at my code
mcadesigns and site.conf
You will see the root option being used
@regal mason
i cant ifnd it
this is what i did
i edited the /etc/nginx/sites-enabled/default
and put in
@gritty stirrup
That should work
Make sure all your images are in that foldsr
And you change your js code so it knows they are there 2
There's a error in your file
You need your server_name to be the domain name
It also gave you a command to try: try it!
my domain is the ip?
it says the config file failed
nvm it says okay when -t
@gritty stirrup
did i map it wrong?
@regal mason Is that folder in the root folder you specified?
i cd into the folder with my images
then i did readlink -f envy_business.png
to get the path copy and paste it into root
the permissions are okay
@regal mason just move all your images to /var/www/html
That is the only place nginx can see them from
Because root /var/www/html
r i p
@regal mason Just move them to /var/www/html/images
Then they can be seen
Or make your root
/home/ubuntu/project/webapp
That's likely a better solution
nP
Howdy
On Ubuntu Server It came with https://prometheus.io pre installed
This uses the web port ":9090"
However, Normally for my servers I use Cockpit multiserver manager
This also uses port ":9090"
How do I uninstall Pometheus? Tried sudo apt-get remove prometheus but it litterally says its not installed (obviously is)
Any ideas?
An open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.
@runic flame Why not change the port it uses?
idk how
So I sorta made a bootable USB, but it's stuck here foever
press Esc and look for any error messages
Is this a good place to as GIT questions?
it's normally #tools-and-devops for that
@robust cave Thanks
Does anyone know if it is possible to run ubuntu remote desktop on a headless server. I need to be able to run some pyautogui code which needs an interface to operate, so I was wondering if I could just use the remote desktop on the headless server as a work around
i dont know what the modern equivalent is, but you can do x forwarding over ssh
Well wouldn't a headless server by definition not have x server?
You may need xvfb
Yep, xvfb plus a VNC server (I went with x11vnc but I don't think it's actively maintained anymore)
i believe you need x installed on the remote host, but it doesnt need a DE or anything
its still technically headless
you should just be able to do it over regular ssh with -X
(i haven't used it in about 13 years)
hey so I got ubuntu to load
but its slow
very slow
like sometimes it works fine, and then it just freezes out of nowhere
I am booting it from a USB stick, but its a Patriot Rage 2
advertising 400mb/sec
check with e.g. top or htop what it's doing
whether CPU is fully loaded, or RAM is full and it starts swapping
or check iotop to get an idea about IO-heavy processes
you can also use sudo hdparm -t /dev/sdX to test the real read speeds of your drive (replace the X with the correct letter)
Well I tried to restart
And now its not loading again
I pressed escape and it told me "you are in emergency mode"
I did cntrl D
Stays for a while on "starting default target"
Then goes back to you are in emergency mode
Also there's this timer of I restart that's 1 minute 30 seconds
And here's what happens when that has finished loading
timed out waiting for disk
that means the entries in your /etc/fstab don't match the real devices/partitions you currently have on this computer
So what do I do
can you run lsblk -f from that emergency thing?
yeah, now try nano /etc/fstab and edit that file so that the UUIDs match
Ooh editor
/boot and swap are broken, according to the boot messages earlier
And while we are here, how can I do that noatime thing, people said thwt speeds up ubuntu
and these UUIDs also change every time you format the partition
yeah it appears to be looking for a partition or something with a uuid that starts with b265
like byte said that only changes if reformat a disk, but there are a lot of reasons it might not be able to see it
eg you removed the disk, the disk died and so on
So what can I do
well you need to find that partition and put it back where the computer can see it, or figure out what that uuid changed to and edit fstab/the boot menu
now there could be another issue
i see it talking about encrypted volumes
did you encrypt a partition?
if so, then the boot process has to have that decrypted before it can see the uuid
Can I have the computer do that, like can I have it remake the entire thing when I delete it or somethin
not really no, if you delete something its possible but difficult to get it back and it can easily be lost if anything else is written to the disk
I tried to change the fstab file
And uhh
Well I tried to make this thing with noatime
Idt it worked lol
if you edited fstab / grub's config after it booted the first time and then restarted
then whatever you edited broke it
Probably
always make backups of critical config files like that before you edit them
eg just cp it to thatfilesname.bak
well youll have to figure out what the file you edited is supposed to look like or reinstall and next time keep a backup of any config files you change so you can revert and try again
Howe
for fstab there are some examples online but you have to make sure you have your own uuids in it
for grub i would boot a distro off usb or something and chroot in to your file system then run dpkg-reconfigure grub
If it won't load, how do I get to the backup anyway
so hold on
i see something
in your lsblk it shows bb265c
in your boot pic i see b265c
Yeah
i think you deleted a b off the front of the uuid in a config file
I'm still in the nano editor and I see a b
Well, I tried adding some stuff to make my USB go faster
So this is essentially what I threw together from copying and pasting random stuff
I want to remove that, and do it the right way
maybe you should try to fix it first before making it faster...
What do I remove and what do I keep
Well yeah, but I'm scared the code I "wrote" will mess it up still
don't explicitly mount stuff like sys, proc, shm and that stuff
Well I don't know what was there and what wasnt
i'd leave it for now then since i think thats often in there and not all distros do it auto
but i dont see anything else really jumping out at me
those are virtual file systems created and managed by the kernel, that stuff definitely does not belong in an fstab, I've never seen it there. Even if it doesn't break things (which I doubt), I see no benefit
just /, /boot and swap
i think it entirely depends on the distro.
I have proc in my fstab on my server for example but not on one of the vms
something has to mount those, and if its not the init system then it could be fstab
remove the last four lines that are not physical partitions or mapper volumes, IMO
i would leave them alone unless we see another error from them because getting them back in there is a huge pain
¯_(ツ)_/¯
so i would NOT remove them unless they are shown to be an issue
the swap line is probably still wrong
I think it should have none swap sw instead of swap swap defaults
Hey it loaded
So next issue
It freezes all the time
Also what's a good better Windows 10 looking modern theme
what
hey so I installed chrome
but when I right click and check properties
it says it cannot find the file
@oak shell i see the virtual file systems in fstab all the time - on a pre-systemd setup, if they're not in there they don't get mounted... don't know what voodoo systemd does
I've never seen those anywhere 🤔
they're not there on my current ubuntu system, but i know they were there three or four years ago
why would you manually specify standard system things like these? They must be the exact same on every Linux anyway
the kernel doesn't know that
you might be doing some exotic setup where you don't mount /proc at all for security
anyway, mount points bind to directories that exist, so it has to be mounted after the root filesystem
idk anyway i need to go soon
is it possible to run without proc??
yeah, just stuff like ps won't work
various other subtle breakages, but it won't immediately grind to a halt - if you have a userspace that doesn't use any of that it'd be fine
so why is ubuntu so slow for me
heh, the installer adding these lines around 2012 has been labeled as bug 😛 https://askubuntu.com/a/181435/367990
anyway, it's partially a separation of concerns thing - it's implemented in the filesystem layer as an ordinary filesystem so you can mount it or not inside chroots etc
literally I cannot search anything without chrome saying it isnt responding
oh and it crashed
did you use the commands I gave you earlier to check whether the bottleneck is ram, cpu, io, ...?
🙄
ByteToday at 21:44
check with e.g. top or htop what it's doing
whether CPU is fully loaded, or RAM is full and it starts swapping
or check iotop to get an idea about IO-heavy processes
you can also use sudo hdparm -t /dev/sdX to test the real read speeds of your drive (replace the X with the correct letter)
terminal is just empty
oh it loaded finally
what do you mean by X as the correct letter
e.g. /dev/sda if that is the drive you're running off
whatever is mounted as your root
how do you know what drive you are running off
God this is so frustrating, it freezes So often I can't do anything
"files has stopped responding"
Also how do I move files into a folder without it telling me I have no permission
I can't even type without it freezing
It's freezing while shutting down So it can't even do thsy
and in iotop?
I see:
1: 6.5%
2: 5.2%
3: 3.1%
4: 3.5%
Mem: 20.6g/7.70g
Swp: ok/ok
mem 20g/7g 🤔
Netlink error: Operation not permitted (1)
The Linux kernel interfaces that iotop relies on now require root privileges
or the NET_ADMIN capability. This change occurred because a security issue
(CVE-2011-2494) was found that allows leakage of sensitive data across user
boundaries. If you require the ability to run iotop as a non-root user, please
configure sudo to allow you to run iotop as root.
Please do not file bugs on iotop about this.
so I do sudo right
yeah
yeah, that's okay then. No real load there
its like something is stopping linux from using all its avaliable resources
so what am I looking for in iotop
any high numbers in the four columns in the middle
should be sorted by highest on top
*constantly high
like >90% IO all the time or so
oh
yeah
umm so I just opened tweaks
and like 3 things in IO are 99.99
hehehe
that might be an issue
why is that happening?
like what is the fault?
dunno, what are they?
jbd2 is the journaling block device driver or something like that
so it has something to do with file system access etc
kworker are kernel worker threads, i.e. the stuff that processes your applications syscalls or so
and gnome-tweaks... yeah, no idea why that would spin up like this
might be the cause, the other two are rather just symptoms
so you did verify your iso before the install?
you might also consider trying to boot a different kernel version, in case your current one has a bug/regression in combination with your specific hardware or whatever, that can happen
you can also keep a terminal with dmesg -w open and watch for any incoming kernel error messages that could indicate hardware or driver problems
but I'll go
now
check the hash sums of the download
and/or select the "check disk for defects" boot option of the installer once
wait what
I just got a theme
but the dock on the left side and everything is still the same
how do I have the theme change that
question
what is the best flavor of ubuntu to get the latest customization tools
I know Plasma Kubuntu is good
but is it the best?
im on 19.04 rn
Take a look at pop os then
ok
so when I try to use the ui to change system folders
it says I don't have permission
and doesn't allow me to
alteast in windows they gave you the option anyway
how can I do that in ubuntu
the ui?
using the ui
i am confused
ui means User Interface, do you mean the GUI? that's Graphical User Interface, which in the context of a default Ubuntu Gnome file manager, would be Nautilus
I don't think there's a trivial way to do that, you might want to use the terminal
trying to install Atom Beta on ubuntu
I got the deb
did dpkg thingy
and it shows up
and I click on it
and it loads for a bit
and nothing happens
also its blue not orange and im sad
also alot of the apps, if I click on it and hit properties, it says "could not find {file}"
@main olive Are you still using Linux from a pendrive?
Yeah it could be it
I tried to install some drivers while using lubuntu from live drive
And i couldn't get it to work
pendrive?
whats that?
you mean like im on the "demo" version?
no I installed it fully
wtf
I can't even get packages from the ubuntu software without it saying I don't have permission
Why can't I just use the GUI as root?!
@main olive You don't use Linux to use the GUI
learn how to use apt, wget and curl
can I make myself root?
I think you can sign in as root.
can I make myself root?
Yes... but please don't
Use terminals to install stuff
Almost every tutorial uses apt-get
If you want the "real Linux experience"
It's with terminals
Just use a terminal
And if it errors, just add sudo to the end of it
I added sudo
shit
thanks for not copying
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
...lol you broke sudo
same error when installing from the Ubuntu Software
or something broke it anyway
uh i don't know if there's an easy way to recover from that
(like, i could do it, but it requires rebooting in single user mode in a way that is not easy to walk you through)
I don't know if I am going to make a full switch if stuff like this happens all the time
which it is happening all the time right now
should I reinstall linux?
ima do that
not like I have any unsaved work
I have no idea why you are having soo many issues.
Are you dual booting?
Something strange?
What version of Ubuntu are you installing?
Uh did you run a command to change file permissions / file owners as root? It looks to me like you somehow changed the permissions of the sudo program, and for security reasons it's refusing to run.
@grave jolt I think it's some sort of dual boot
make the full switch his language suggests to me
Yeah but that would have nothing to do with this error
No
It can't even see the file system. Windows doesn't support non Ms filesystems
If it touches anything it would be by deleting the whole file system and replacing it with an empty vfat or NTFS one
This is also not an error I would expect to see due to filesystem corruption really, though they can check the system logs to be sure. There would be a lot of other errors if there are drive or other hardware issues
I expect he thought something like "I want that all files belong to me" and chowned the system
especially after the "can I login as root" questions
so yeah, that of course breaks everything
and sudo is not refusing for security reasons, it needs owner root and suid bit set to work. That is the only way it can actually gain elevated privileges in order to pass them to other programs, afaik
yes that is correct, security isnt the reason myb. setuid and owner root make linux run it as root regardless of who executes it. then it figures out if you have the right permissions to do what you told sudo to do
if its run as you user it wouldnt have the priv it needs to run as anyone else
oh however, if you managed to change the permissions of important files like sudo you prob ruined the install.
though of course it also doesn't like if /etc/sudoers is accessible to anyone other than root, and that one is for security reasons
yeah there are likely a ton of files that want specific priv for one reason or another, ssh, su, various config files etc
and messing up those permissions means you might as well reinstall because its a huge pain to restore them if yo udont have snapshots/backups of those files with the right permissions
correct
ah sorry
rip
well I reinstalled ubuntu
but I wanted to try kubuntu
so I did that
and theres this sweet theme
called sweet
and its like transparent
but when I put it on it isn't transparent
I can make the window decorations cool
but how do I make the window itself transparent
weird question
so I have an ubuntu server that I can log into. I want to generate ssh keys from the server that I can distribute to clients (rather than generating on client and registering with the server). Is that possible?
It should work the same.
how do I register the keys though
(or another question: how would I generate new keys from a client if I already have passwordauthentication disabled?)
ah, I just manually added to my authorized keys
howdy. How do I quickly preferably in as little commands as possible make a python3 file a .service. So I can do shizzle like systemctl restart blahblah.service
Make __init__.py file in the home directory of your file/project
You have to write a service file. That has nothing directly to do with python, it's the same for everything.
general tutorial/explanation of systemd files https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files
shorter/simpler tutorial https://linuxconfig.org/how-to-create-systemd-service-unit-in-linux
In this tutorial we analyze the structure of systemd ".service" units, and examine the most common
options which can be used to modify how the service behaves. We see how to set dependencies for a service and how can we
specify the commands to be executed when it is started s...
answer with basic example https://unix.stackexchange.com/a/74623/103151
ah thanks
Is it safe to delete the .cache/pipenv/http folder? Thing is taking up over 1GB of precious space, and if that is really only download cache, it's worth to clean up.
What other kind of cache could it be if not that?
Though I thought it had a cache in addition to pip 🤔
pip cache is different, but a lot smaller
though structurally .cache/pip and .cache/pipenv look similar, so I guess pipenv just uses its own and doesn't care about pip
moved to trash now, if nothing breaks in the near future I'll empty it.
For what it's worth I do know that pipenv uses pip's environment variable to disable its own cache too
So it cares about it in that regard
¯_(ツ)_/¯
i was facing some problems on setting up a dl environment
from these instructions
https://medium.com/@k_efth/deep-learning-in-arch-linux-from-start-to-finish-with-pytorch-tensorflow-nvidia-cuda-9a873c2252ed
in ""The Deep Learning Stuff
for the second command here do i need to create this directory? https://gyazo.com/4e2ac7758ab6f1a98bcf1c8645f2ebd5 https://gyazo.com/b094ad97d522519dfd8e1a3cc7e44641
its giving an error in manjaro
in manjaro
gnome
so yeah, can't add users
so, when you see help text saying "try/add/use --some-option"
it means that you add it to the command itself
It doesn't say that
--some-option is not a command of itself, it is rather an argument to a program that you're trying to run. the description is telling you that you can relax the check by doing adduser Monopoly --force-badname
--arg and -arg almost always indicate a command line argument
okey, and the error message wasn't super informative.. but you can try to search around for why adduser exits with error code 1
adduser just calls useradd anyway
and it's useradd returning the error code
and none are working
i don't understand
why can't i add fucking users to my vps
sorry i am angry now
the man page tells you what error code 1 means
useradd exit code 1 means "can't update password file", which I find somewhat strange, and maybe even hard to believe, given that he's running the command as root
that makes 2 of us
sooo... what do i dooo
if you do cat /etc/passwd do you get a result? (please don't show us the result tho)
You get the badname problem because of the capital M
weird. grote should be right because the regex is [a-z_][a-z0-9_-]*[$]
ah that's more helpful
useradd and adduser arent' the same thing
ok
adduser still makes use of useradd in the end tho...
it uses useradd in the backend, but you still shouldn't use that.
that's true yea. but still doesn't explain the issue at hand
bruhh
or is there another way
i can't add users on my vps
what operating system ?
any messages sent in terminal ?
what are the permissions on etc/shadow?
Adding user `testaccount' ...
Adding new group `testaccount' (1014) ...
Adding new user `testaccount' (1005) with group `testaccount' ...
useradd: cannot open /etc/shadow
adduser: `/usr/sbin/useradd -d /home/testaccount -g testaccount -s /bin/bash -u 1005 testaccount' returned error code 1. Exiting.
root@debian:~#
wtff
do a ls -la /etc/shadow pls
ehm.
ok
is root from sudo -i? debian doesnt enable root password iirc
-rw-r----- 1 root shadow 1533 Apr 2 17:19 /etc/shadow
root@debian:~#
wdym
yes it's sudo -i
i disabled direct root login
yeah check the suders file
it does iirc
my account is in sudoers
your permissions are correct for /etc/shadow
but i can't even see /etc/shadow in a FSTP
not just the account, but the rules
it's not there
root@debian:~#
shadow is a file
yea it isn't a directory
it's a file, not a directory
-----a------------- /etc/shadow
root@debian:~#```
why does it switch between root@ and bash-
that's weird
too
it's not
ok
you shouldn't really login as root ever tbh
why not
did you sudo su ?
great way to break stuff @bright latch
meh
having to type sudo everytime makes it less likely to fuck up from my experience
they do the same thing lol
¯_(ツ)_/¯
ill head on mine and check which is which
try sudo su, if you havent already
yea that a flag is weird
sudo -i is a little different than sudo su and sudo -s but that shouldn't be an issue
what about the permissons now?
same error
gotta do chattr
was about to suggest that
Adding user `fuckmylife' ...
Adding new group `fuckmylife' (1016) ...
Adding new user `fuckmylife' (1005) with group `fuckmylife' ...
useradd: cannot open /etc/shadow
adduser: `/usr/sbin/useradd -d /home/fuckmylife -g fuckmylife -s /bin/bash -u 1005 fuckmylife' returned error code 1. Exiting.
root@debian:~#
what?
chattr -a /etc/shadow
you know it's making all these "groups" each time i attempt, it means i can't use that name again. how do i delete those too?
and chattr +e /etc/shadow
ah
try again now
that's a filething.
a is for append only though, would that give a cannot open message?
maybe. I mean there is no reason for that flag anyway
fixed?
Adding user `ihatedebian' ...
Adding new group `ihatedebian' (1017) ...
Adding new user `ihatedebian' (1005) with group `ihatedebian' ...
Creating home directory `/home/ihatedebian' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for ihatedebian
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
root@debian:~#```
yea
but
i need to delete previous "groups"
all those errors before
failed accounts
they apparently exist somewhere
not sure they show up anywhere
no home dirs doesn't mean they arent' a user
exactly
i also make sure to do chattr +i /etc/shadow so i dont make a user i dont want
do a cat /etc/passwd and see if they show up
wait what command are you using to add users?
should i show the message?
he used adduser last
ok
so i assume adduser
which message?
then they don't exist
all i have is this:
adduser: The group `monopoly' already exists.
root@debian:~#
^
single-poly
wait
they do exist apparently
just do groupdel group
group group does not exist
oh wait nvm XD
ok, so now we go back to the very first question i needed help with.
making a python file start upon a user login.
so i added python /etc/ServerRestrictor.py to the end of that user's bashrc file
and got this:
(as root)
su into the user
ok
then add the file to bashrc
dont do it as root unless you want the user to not have a useable bashrc
why
how does that work
but the question is:
should i normally have permission?
to edit it?
then my vps is super gae
chmod +777 /home ?
no
rip
If the file is owned by root, the user can't really do anything with it.
then definitely owned by root
Ok It Works 😃
btw it's a restrictor
means they can't access the terminal.. just commands inside the script.
which open other scripts
and their paths
and bam i have a commands list
that's one of the problems you can run into with running as root, accidently changing file owners.
so what? copy and paste a really long password enter it and then delete it so you won't ever remember it
i'm gonna try and get a script that monitors and key logs users idfk how
im gonna guess you've not been using linux for a while
5. We will not help you with anything that might break a law or the terms of service of any other community, site, service, or otherwise - No piracy, brute-forcing, captcha circumvention, sneaker bots, or anything else of that nature.
Key logging falls under that rule as well
Oh
what are all the commands to break out of a python script?
i'll test it and see if they can escape or not.
if they can i'll paste like x1000 of python /etc/ServerRestrictor.pys
CTRL + C is the typical one to break out of a running script
I don't know what you've done
disabled CTRL
key
@vestal turret i have a question
i'm unable to drag some files into /etc using sftp mobaxterm i get this:
Why are you trying to copy over pyc files?
no it's giving me permission denied error message
on root user
i'm moving files from my desktop to the /etc directory
wh
but it won't let, wtf
what on earth are you manually copying user files to /etc for
well then how do i do it 🤔
dont even know what youre trying to do, firstly
why do you want to do that
BECAUSE I WANT THE FILES ON MY VPS 😠
/etc is for system configuration files
which is a system folder
yes
wh
i really dont want to play part of potentially messing up your stuff, sorry
permission denied as root, why is root permission denied
that's all im asking
why is the highest account on the vps not allowed to access
that's what i assume anyway
Well that's probably why
You'd want to have it in its own folder regardless
And even then, there really isn't a good reason to have it in etc
also /opt
The entire thing feels like a big hack that I'm not overly comfortable with here
I didn't scroll up far enough to read the context and be as shocked as I should be, probably
@gilded sparrow I had that too recently idk y either
it was something related to networking
forgot what the fuck I was doing but the VPS wasn't happy about it
🤷
How can i disabe the login message
Last login: yesterday IP...
Blah blah
Debian GNU/Linux blah blh
How do i disable that
are you talking about the message of the day?
O yeaa
What about last login:
And IP
AnimeIsLovelyy
Last login: Tue May 21 07:00:53 2019 from 0.0.0.0```
Is what it is now /:
😢
the last login part is hard coded into your system
you would need to edit and recompile the C file
I do not know how to do it. look for Byte and when he is available (green light) you could try to ask him
is summoned
cool.. do you know if you must edit and compile loginrec.c to be able to remove the Last Login : timestamp from IP message when you login to debian?
is that not ssh only?
do not ask me, Im way out of my comfort zone 😄
man sshd_config
PrintLastLog
Specifies whether sshd(8) should print the date and time of the last user login when a user logs in interactively.
The default is yes.
I think it's that.
@gilded sparrow is this ssh login only, or local login?
SSH
I'd personally leave it enabled, just so you see when your account was used last time. It's not a safe indicator of any tampering, but at least a bit.
Yeah, then you just have to write a line like this in your /etc/ssh/sshd_config:
PrintLastLog no
I think you need to sudo systemctl reload ssh afterwards to reload the ssh server config.
Ok fixed
Bur
I still have
Linux debian 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3 (2019-02-02) x86_64
I would guess that is created by any of the scripts in /etc/update-motd.d. Check which of them is responsible for it and just make it non-executable with sudo chmod -x /etc/update-motd.d/XX-WHATEVER
probably the 00-header script. At least that's what makes something similar on Ubuntu.
🤷 dunno then off the top of my head
@gilded sparrow is there /etc/issue ?
(i'm not sure if that's what generates something like that but it may be worth checking)
sure that 10-uname is empty? If you open it with nano and typo the file name, it will open a new file instead. Because that output line is exactly what uname would print.
what do you see for ls -l /etc/update-motd.d
Idk
But I Fixed It
Thankss
Omfg
Looks Better 😍
By Default I Want All IPs Disabled.
Anyone Who Wants To Log Into My VPS Will Have To Ask Me To Put Their IP In A File To Grant Permission. Will This Cause Any Issues?
I'll Be Using IPTables.
what happens if your ip address changes
there are cases where ip whitelisting makes sense, but if the primary administrator can only access the system from a residential ip address, you have to be very careful
can your hosting provider provide console access?
No
I have a spare vps. If i can install openvpn onto it, i'd get a locked-ip vpn right?
:/
depends on your cloud provider if they assign the vps a static or dynamic ip
Static
idk I think this is where we go
Im on ubuntu
lets say I have a console
and it can connect to my laptop
lets say theres a connector
that needs to connect to my console
can I connect through my laptop
and use it like a usb bridge
please
Does anyone have a script which tells me the users that are online
There is one by default but i'd like to be able to see IPs of the users
on the vps
please
Hmm?
help
Can Someone Teach Me How To Use My Laptop As A USB Bridge
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
Hey
i have allowed my ip to connect to my vps using iptables, how do i now disable every other IP?
i don't know the IPs specifically, i just want it to check if it's in the iptables. if not, it's blocked.
!warn @dawn plaza we don‘t do „lmgtfy“ or derivatives here. if you don‘t want to help, then don‘t
:incoming_envelope: :ok_hand: warned @dawn plaza (we don‘t do „lmgtfy“ or derivatives here. if you don‘t want to help, then don‘t).
Fair enough
pls help
@gilded sparrow i dont know the specifics, but you can create a table in iptables that is a list of allowed ips and then have block all as a rule at the end.
i dont recommend this at all though
you are better off using vpn or ssh or something with preshared keys/ a proper key sigining system to secure access
if your ip changes on the client side, youll lose access if you hard code what ips are allowed to conncet
if you set up a firewall to block all incoming connections except for vpn/ssh, you effectively are whitelisting access to local services to only people that you have given access to.
vpns/ssh are much much more secure than any home brew system
@gilded sparrow who or w tell you all currently logged in users. last shows you a list of previous sessions.
It Can't See What They're Typing Or Commands They're Running?
You can see what commands they're running if you run ps or htop
(which is a good reason not to put anything secure on a command line argument)
Can someone tell me how to use my laptop as a USB bridge?
and to everyone telling me to look it up on google, please look at the results first. I looked there first, that is precicely why I am asking here now
What do you mean by usb bridge?
I want to connect 2 usbs devices together through my laptop
the name of a cable that does that is a usb bridge
is one of them normally a usb host in this situation? if so i imagine this is going to be a huge pain in the butt and likely not supported by the usb drivers on your laptop
what are the specific usb devices?
how to make my python script globally accesible like git once installed can be accessed gloabally?
There are basically three requirements:
- executable permissions set for the script
- a she-bang at the top indicating that it should be executed with the python interpreter
- it needs to be in a location that's on PATH.